snuyanzin commented on code in PR #28622:
URL: https://github.com/apache/flink/pull/28622#discussion_r3695563636
##########
flink-libraries/flink-cep/src/test/java/org/apache/flink/cep/nfa/compiler/NFACompilerTest.java:
##########
@@ -129,48 +116,50 @@ public void testNFACompilerWithSimplePattern() {
NFA<Event> nfa = compile(pattern, false);
Collection<State<Event>> states = nfa.getStates();
- assertEquals(4, states.size());
+ assertThat(states).hasSize(4);
Map<String, State<Event>> stateMap = new HashMap<>();
for (State<Event> state : states) {
stateMap.put(state.getName(), state);
}
- assertTrue(stateMap.containsKey("start"));
+ assertThat(stateMap).containsKey("start");
State<Event> startState = stateMap.get("start");
- assertTrue(startState.isStart());
+ assertThat(startState.isStart()).isTrue();
final Set<Tuple2<String, StateTransitionAction>> startTransitions =
unfoldTransitions(startState);
- assertEquals(
- Sets.newHashSet(Tuple2.of("middle",
StateTransitionAction.TAKE)), startTransitions);
+ assertThat(startTransitions)
+ .isEqualTo(Sets.newHashSet(Tuple2.of("middle",
StateTransitionAction.TAKE)));
- assertTrue(stateMap.containsKey("middle"));
+ assertThat(stateMap).containsKey("middle");
State<Event> middleState = stateMap.get("middle");
final Set<Tuple2<String, StateTransitionAction>> middleTransitions =
unfoldTransitions(middleState);
- assertEquals(
- Sets.newHashSet(
- Tuple2.of("middle", StateTransitionAction.IGNORE),
- Tuple2.of("end", StateTransitionAction.TAKE)),
- middleTransitions);
+ assertThat(middleTransitions)
+ .isEqualTo(
+ Sets.newHashSet(
+ Tuple2.of("middle",
StateTransitionAction.IGNORE),
+ Tuple2.of("end", StateTransitionAction.TAKE)));
- assertTrue(stateMap.containsKey("end"));
+ assertThat(stateMap).containsKey("end");
State<Event> endState = stateMap.get("end");
final Set<Tuple2<String, StateTransitionAction>> endTransitions =
unfoldTransitions(endState);
- assertEquals(
- Sets.newHashSet(
- Tuple2.of(NFACompiler.ENDING_STATE_NAME,
StateTransitionAction.TAKE)),
- endTransitions);
-
- assertTrue(stateMap.containsKey(NFACompiler.ENDING_STATE_NAME));
+ assertThat(endTransitions)
+ .isEqualTo(
+ Sets.newHashSet(
Review Comment:
same here and in other places
--
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]