You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "snuyanzin (via GitHub)" <gi...@apache.org> on 2026/08/01 11:29:42 UTC
Re: [PR] [FLINK-39876][tests] Migrate flink-streaming-java assertions to AssertJ [flink]
snuyanzin commented on code in PR #28835:
URL: https://github.com/apache/flink/pull/28835#discussion_r3695518844
##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/ProcessingTimeSessionWindowsTest.java:
##########
@@ -224,4 +212,24 @@ void testDynamicGapProperties() {
assertThat(assigner).isNotNull();
assertThat(assigner.isEventTime()).isFalse();
}
+
+ /**
+ * Matches a collection containing exactly the expected windows, in any order, counting
+ * duplicates.
+ */
+ private static Collection<TimeWindow> containsInAnyOrder(TimeWindow... windows) {
+ return argThat(
+ actual -> {
+ if (actual == null) {
+ return false;
+ }
+ final List<TimeWindow> remaining = new ArrayList<>(actual);
+ for (TimeWindow window : windows) {
+ if (!remaining.remove(window)) {
+ return false;
+ }
+ }
+ return remaining.isEmpty();
+ });
+ }
Review Comment:
It does not look like a solution
we have multiple tests using this method.
How should we continue there? Create same helper for every class?
Please do not blindly trust AI
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org