nine03 commented on code in PR #2557:
URL: https://github.com/apache/streampipes/pull/2557#discussion_r1524660763
##########
streampipes-extensions/streampipes-processors-transformation-jvm/src/test/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/counter/TestBooleanCounterProcessor.java:
##########
@@ -46,50 +48,38 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.stream.Stream;
-import static org.junit.Assert.assertEquals;
-
-@RunWith(Parameterized.class)
public class TestBooleanCounterProcessor {
private static final Logger LOG =
LoggerFactory.getLogger(TestBooleanCounterProcessor.class);
- @org.junit.runners.Parameterized.Parameters
- public static Iterable<Object[]> data() {
- return Arrays.asList(new Object[][]{
- {"Test", "BOTH", Arrays.asList(false, true), 1},
- {"Test", "BOTH", Arrays.asList(false, true, false), 2},
- {"Test", "BOTH", Arrays.asList(false), 0},
- {"Test", "TRUE -> FALSE", Arrays.asList(false, true, false, false,
true), 2},
- {"Test", "TRUE -> FALSE", Arrays.asList(true, false), 1},
- {"Test", "TRUE -> FALSE", Arrays.asList(false), 1},
- {"Test", "FALSE -> TRUE", Arrays.asList(false), 0},
- {"Test", "FALSE -> TRUE", Arrays.asList(false, false, true), 1},
- {"Test", "FALSE -> TRUE", Arrays.asList(false, true, true, false),
1},
- });
+ static Stream<Arguments> data() {
+ return Stream.of(
+ Arguments.of("Test", "BOTH", Arrays.asList(false, true), 1),
+ Arguments.of("Test", "BOTH", Arrays.asList(false, true, false), 2),
+ Arguments.of("Test", "BOTH", Arrays.asList(false), 0),
+ Arguments.of("Test", "TRUE -> FALSE", Arrays.asList(false, true,
false, false, true), 2),
+ Arguments.of("Test", "TRUE -> FALSE", Arrays.asList(true, false),
1),
+ Arguments.of("Test", "TRUE -> FALSE", Arrays.asList(false), 1),
+ Arguments.of("Test", "FALSE -> TRUE", Arrays.asList(false), 0),
+ Arguments.of("Test", "FALSE -> TRUE", Arrays.asList(false, false,
true), 1),
+ Arguments.of("Test", "FALSE -> TRUE", Arrays.asList(false, true,
true, false), 1)
+ );
}
- @org.junit.runners.Parameterized.Parameter
- public String invertFieldName;
-
- /**
- * Defines which boolean changes should be counted
- * 0: BOTH
- * 1: TRUE -> FALSE
- * 2: FALSE -> TRUE
- */
- @org.junit.runners.Parameterized.Parameter(1)
- public String flankUp;
-
- @org.junit.runners.Parameterized.Parameter(2)
- public List<Boolean> eventBooleans;
+ @ParameterizedTest
+ @MethodSource("data")
+ public void testBooleanCounter(
+ String invertFieldName,
+ String flankUp,
+ List<Boolean> eventBooleans,
+ Integer expectedBooleanCount
+ ){
- @org.junit.runners.Parameterized.Parameter(3)
- public Integer expectedBooleanCount;
-
- @Test
- public void testBooleanCounter() {
BooleanCounterProcessor booleanCounter = new BooleanCounterProcessor();
- DataProcessorDescription originalGraph =
booleanCounter.declareConfig().getDescription();
+// DataProcessorDescription originalGraph =
booleanCounter.declareConfig().getDescription();
Review Comment:
```
DataProcessorDescription originalGraph =
booleanCounter.declareConfig().getDescription();
```
Initially it was written like this, but after junit5 migration it didn't
work.
```
IDataProcessorConfiguration config = booleanCounter.declareConfig();
DataProcessorDescription originalGraph = config.getDescription();
```
and I got the error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]