File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
src/main/java/org/apache/beam/runners/core Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ dependencies {
4848 implementation library. java. slf4j_api
4949 implementation library. java. jackson_core
5050 implementation library. java. jackson_databind
51+ implementation library. java. hamcrest
5152 testImplementation project(path : " :sdks:java:core" , configuration : " shadowTest" )
5253 testImplementation library. java. junit
5354 testImplementation library. java. mockito_core
Original file line number Diff line number Diff line change 2020import java .util .Collection ;
2121import java .util .Objects ;
2222import org .apache .beam .sdk .transforms .windowing .BoundedWindow ;
23+ import org .apache .beam .sdk .transforms .windowing .GlobalWindow ;
2324import org .apache .beam .sdk .transforms .windowing .IntervalWindow ;
2425import org .apache .beam .sdk .transforms .windowing .PaneInfo ;
2526import org .apache .beam .sdk .values .WindowedValue ;
3132import org .joda .time .Instant ;
3233
3334/** Matchers that are useful for working with Windowing, Timestamps, etc. */
35+ @ SuppressWarnings ({
36+ "nullness" // TODO(https://github.com/apache/beam/issues/20497)
37+ })
3438public class WindowMatchers {
3539
3640 public static <T > Matcher <WindowedValue <? extends T >> isWindowedValue (
@@ -166,6 +170,11 @@ protected void describeMismatchSafely(
166170 };
167171 }
168172
173+ public static <T > Matcher <WindowedValue <? extends T >> isValueInGlobalWindow (
174+ T value , Instant timestamp ) {
175+ return isSingleWindowedValue (value , timestamp , GlobalWindow .INSTANCE );
176+ }
177+
169178 @ SuppressWarnings ({"unchecked" , "rawtypes" })
170179 @ SafeVarargs
171180 public static final <W extends BoundedWindow > Matcher <Iterable <W >> ofWindows (
You can’t perform that action at this time.
0 commit comments