Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuukadesu committed Nov 6, 2024
1 parent e10638b commit ef20d02
Showing 1 changed file with 31 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ public void detectAdditionOperator() {
.configWithDefaultPrefix(MathOpProcessor.RIGHT_OPERAND, "rightOperand")
.config(MathOpProcessor.OPERATION, "+").build();

List<Map<String, Object>> inputEvents = List.of(Map.of("leftOperand", 5.0d, "rightOperand", 5.0d));
List<Map<String, Object>> outputEvents = List
.of(Map.of("leftOperand", 5.0d, "rightOperand", 5.0d, "calculationResult", 10.0d));
ProcessingElementTestExecutor testExecutor = new ProcessingElementTestExecutor(processor, leftOperandConfiguration);
List<Map<String, Object>> inputEvents = List.of(
Map.of("leftOperand", 5.0d, "rightOperand", 5.0d));
List<Map<String, Object>> outputEvents = List.of(
Map.of("leftOperand", 5.0d, "rightOperand", 5.0d, "calculationResult", 10.0d));
ProcessingElementTestExecutor testExecutor = new ProcessingElementTestExecutor(
processor, leftOperandConfiguration);

testExecutor.run(inputEvents, outputEvents);
}
Expand All @@ -57,10 +59,12 @@ public void detectSubtractionOperator() {
.configWithDefaultPrefix(MathOpProcessor.RIGHT_OPERAND, "rightOperand")
.config(MathOpProcessor.OPERATION, "-").build();

List<Map<String, Object>> inputEvents = List.of(Map.of("leftOperand", 5.0d, "rightOperand", 5.0d));
List<Map<String, Object>> outputEvents = List
.of(Map.of("leftOperand", 5.0d, "rightOperand", 5.0d, "calculationResult", 0.0d));
ProcessingElementTestExecutor testExecutor = new ProcessingElementTestExecutor(processor, leftOperandConfiguration);
List<Map<String, Object>> inputEvents = List.of(
Map.of("leftOperand", 5.0d, "rightOperand", 5.0d));
List<Map<String, Object>> outputEvents = List.of(
Map.of("leftOperand", 5.0d, "rightOperand", 5.0d, "calculationResult", 0.0d));
ProcessingElementTestExecutor testExecutor = new ProcessingElementTestExecutor(
processor, leftOperandConfiguration);

testExecutor.run(inputEvents, outputEvents);
}
Expand All @@ -72,10 +76,12 @@ public void detectMultiplicationOperator() {
.configWithDefaultPrefix(MathOpProcessor.RIGHT_OPERAND, "rightOperand")
.config(MathOpProcessor.OPERATION, "*").build();

List<Map<String, Object>> inputEvents = List.of(Map.of("leftOperand", 5.0d, "rightOperand", 5.0d));
List<Map<String, Object>> outputEvents = List
.of(Map.of("leftOperand", 5.0d, "rightOperand", 5.0d, "calculationResult", 25.0d));
ProcessingElementTestExecutor testExecutor = new ProcessingElementTestExecutor(processor, leftOperandConfiguration);
List<Map<String, Object>> inputEvents = List.of(
Map.of("leftOperand", 5.0d, "rightOperand", 5.0d));
List<Map<String, Object>> outputEvents = List.of(
Map.of("leftOperand", 5.0d, "rightOperand", 5.0d, "calculationResult", 25.0d));
ProcessingElementTestExecutor testExecutor = new ProcessingElementTestExecutor(
processor, leftOperandConfiguration);

testExecutor.run(inputEvents, outputEvents);
}
Expand All @@ -87,10 +93,12 @@ public void detectDivisionOperator() {
.configWithDefaultPrefix(MathOpProcessor.RIGHT_OPERAND, "rightOperand")
.config(MathOpProcessor.OPERATION, "/").build();

List<Map<String, Object>> inputEvents = List.of(Map.of("leftOperand", 5.0d, "rightOperand", 5.0d));
List<Map<String, Object>> outputEvents = List
.of(Map.of("leftOperand", 5.0d, "rightOperand", 5.0d, "calculationResult", 1.0d));
ProcessingElementTestExecutor testExecutor = new ProcessingElementTestExecutor(processor, leftOperandConfiguration);
List<Map<String, Object>> inputEvents = List.of(
Map.of("leftOperand", 5.0d, "rightOperand", 5.0d));
List<Map<String, Object>> outputEvents = List.of(
Map.of("leftOperand", 5.0d, "rightOperand", 5.0d, "calculationResult", 1.0d));
ProcessingElementTestExecutor testExecutor = new ProcessingElementTestExecutor(
processor, leftOperandConfiguration);

testExecutor.run(inputEvents, outputEvents);
}
Expand All @@ -102,11 +110,13 @@ public void detectModulusOperator() {
.configWithDefaultPrefix(MathOpProcessor.RIGHT_OPERAND, "rightOperand")
.config(MathOpProcessor.OPERATION, "%").build();

List<Map<String, Object>> inputEvents = List.of(Map.of("leftOperand", 5.0d, "rightOperand", 5.0d));
List<Map<String, Object>> outputEvents = List
.of(Map.of("leftOperand", 5.0d, "rightOperand", 5.0d, "calculationResult", 0.0d));
ProcessingElementTestExecutor testExecutor = new ProcessingElementTestExecutor(processor, leftOperandConfiguration);
List<Map<String, Object>> inputEvents = List.of(
Map.of("leftOperand", 5.0d, "rightOperand", 5.0d));
List<Map<String, Object>> outputEvents = List.of(
Map.of("leftOperand", 5.0d, "rightOperand", 5.0d, "calculationResult", 0.0d));
ProcessingElementTestExecutor testExecutor = new ProcessingElementTestExecutor(
processor, leftOperandConfiguration);

testExecutor.run(inputEvents, outputEvents);
}
}
}

0 comments on commit ef20d02

Please sign in to comment.