Interface PAssert.IterableAssert<T>
-
- All Known Implementing Classes:
PAssert.PCollectionContentsAssert
- Enclosing class:
- PAssert
public static interface PAssert.IterableAssert<T>
Builder interface for assertions applicable to iterables and PCollection contents.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description PAssert.IterableAssert<T>
containsInAnyOrder()
Deprecated.Preferempty()
to this method.PAssert.IterableAssert<T>
containsInAnyOrder(java.lang.Iterable<T> expectedElements)
Asserts that the iterable in question contains the provided elements.PAssert.IterableAssert<T>
containsInAnyOrder(SerializableMatcher<? super T>... expectedElements)
Asserts that the iterable in question matches the provided elements.PAssert.IterableAssert<T>
containsInAnyOrder(T... expectedElements)
Asserts that the iterable in question contains the provided elements.PAssert.IterableAssert<T>
empty()
Asserts that the iterable in question is empty.PAssert.IterableAssert<T>
inCombinedNonLatePanes(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window across all panes that were not produced by the arrival of late data.PAssert.IterableAssert<T>
inEarlyGlobalWindowPanes()
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on panes in theGlobalWindow
that were emitted before theGlobalWindow
closed.PAssert.IterableAssert<T>
inEarlyPane(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window across all panes that were produced by the arrival of early data.PAssert.IterableAssert<T>
inFinalPane(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window, running the checker only on the final pane for each key.PAssert.IterableAssert<T>
inLatePane(BoundedWindow window)
Creates a newPAssert.IterableAssert
with the assertion restricted to only run on the provided window across all panes that were produced by the arrival of late data.PAssert.IterableAssert<T>
inOnlyPane(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window.PAssert.IterableAssert<T>
inOnTimePane(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window.PAssert.IterableAssert<T>
inWindow(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window.PAssert.IterableAssert<T>
satisfies(SerializableFunction<java.lang.Iterable<T>,java.lang.Void> checkerFn)
Applies the provided checking function (presumably containing assertions) to the iterable in question.
-
-
-
Method Detail
-
inWindow
PAssert.IterableAssert<T> inWindow(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window.The assertion will concatenate all panes present in the provided window if the
Trigger
produces multiple panes. If the windowing strategy accumulates fired panes and triggers fire multple times, consider using insteadinFinalPane(BoundedWindow)
orinOnTimePane(BoundedWindow)
.- Returns:
- a new
PAssert.IterableAssert
like this one but with the assertion only applied to the specified window.
-
inOnlyPane
PAssert.IterableAssert<T> inOnlyPane(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window.The assertion will expect outputs to be produced to the provided window exactly once. If the upstream
Trigger
may produce output multiple times, consider instead usinginFinalPane(BoundedWindow)
orinOnTimePane(BoundedWindow)
.- Returns:
- a new
PAssert.IterableAssert
like this one but with the assertion only applied to the specified window.
-
inFinalPane
PAssert.IterableAssert<T> inFinalPane(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window, running the checker only on the final pane for each key.If the input
WindowingStrategy
does not always produce final panes, the assertion may be executed over an empty input even if the trigger has fired previously. To ensure that a final pane is always produced, set theWindow.ClosingBehavior
of the windowing strategy (viaWindow.withAllowedLateness(Duration, ClosingBehavior)
settingWindow.ClosingBehavior
toWindow.ClosingBehavior.FIRE_ALWAYS
).- Returns:
- a new
PAssert.IterableAssert
like this one but with the assertion only applied to the specified window.
-
inOnTimePane
PAssert.IterableAssert<T> inOnTimePane(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window.- Returns:
- a new
PAssert.IterableAssert
like this one but with the assertion only applied to the specified window.
-
inEarlyPane
PAssert.IterableAssert<T> inEarlyPane(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window across all panes that were produced by the arrival of early data.- Returns:
- a new
PAssert.IterableAssert
like this one but with the assertion only applied to the specified window.
-
inLatePane
PAssert.IterableAssert<T> inLatePane(BoundedWindow window)
Creates a newPAssert.IterableAssert
with the assertion restricted to only run on the provided window across all panes that were produced by the arrival of late data.- Returns:
- a new
PAssert.IterableAssert
like this one but with the assertion only applied to the specified window.
-
inCombinedNonLatePanes
PAssert.IterableAssert<T> inCombinedNonLatePanes(BoundedWindow window)
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window across all panes that were not produced by the arrival of late data.- Returns:
- a new
PAssert.IterableAssert
like this one but with the assertion only applied to the specified window.
-
inEarlyGlobalWindowPanes
PAssert.IterableAssert<T> inEarlyGlobalWindowPanes()
Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on panes in theGlobalWindow
that were emitted before theGlobalWindow
closed. These panes havePaneInfo.Timing.EARLY
.
-
containsInAnyOrder
PAssert.IterableAssert<T> containsInAnyOrder(T... expectedElements)
Asserts that the iterable in question contains the provided elements.- Returns:
- the same
PAssert.IterableAssert
builder for further assertions
-
containsInAnyOrder
PAssert.IterableAssert<T> containsInAnyOrder(SerializableMatcher<? super T>... expectedElements)
Asserts that the iterable in question matches the provided elements.- Returns:
- the same
PAssert.IterableAssert
builder for further assertions
-
containsInAnyOrder
@Deprecated PAssert.IterableAssert<T> containsInAnyOrder()
Deprecated.Preferempty()
to this method.Asserts that the iterable in question is empty.- Returns:
- the same
PAssert.IterableAssert
builder for further assertions
-
containsInAnyOrder
PAssert.IterableAssert<T> containsInAnyOrder(java.lang.Iterable<T> expectedElements)
Asserts that the iterable in question contains the provided elements.- Returns:
- the same
PAssert.IterableAssert
builder for further assertions
-
empty
PAssert.IterableAssert<T> empty()
Asserts that the iterable in question is empty.- Returns:
- the same
PAssert.IterableAssert
builder for further assertions
-
satisfies
PAssert.IterableAssert<T> satisfies(SerializableFunction<java.lang.Iterable<T>,java.lang.Void> checkerFn)
Applies the provided checking function (presumably containing assertions) to the iterable in question.- Returns:
- the same
PAssert.IterableAssert
builder for further assertions
-
-