Interface PAssert.IterableAssert<T>
- All Known Implementing Classes:
PAssert.PCollectionContentsAssert
- Enclosing class:
PAssert
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.containsInAnyOrder
(Iterable<T> expectedElements) Asserts that the iterable in question contains the provided elements.containsInAnyOrder
(SerializableMatcher<? super T>... expectedElements) Asserts that the iterable in question matches the provided elements.containsInAnyOrder
(T... expectedElements) Asserts that the iterable in question contains the provided elements.empty()
Asserts that the iterable in question is empty.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.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.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.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.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.inOnlyPane
(BoundedWindow window) Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window.inOnTimePane
(BoundedWindow window) Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window.inWindow
(BoundedWindow window) Creates a newPAssert.IterableAssert
like this one, but with the assertion restricted to only run on the provided window.satisfies
(SerializableFunction<Iterable<T>, Void> checkerFn) Applies the provided checking function (presumably containing assertions) to the iterable in question.
-
Method Details
-
inWindow
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
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
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
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
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
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
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
Asserts that the iterable in question contains the provided elements.- Returns:
- the same
PAssert.IterableAssert
builder for further assertions
-
containsInAnyOrder
Asserts that the iterable in question matches the provided elements.- Returns:
- the same
PAssert.IterableAssert
builder for further assertions
-
containsInAnyOrder
Deprecated.Preferempty()
to this method.Asserts that the iterable in question is empty.- Returns:
- the same
PAssert.IterableAssert
builder for further assertions
-
containsInAnyOrder
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
Applies the provided checking function (presumably containing assertions) to the iterable in question.- Returns:
- the same
PAssert.IterableAssert
builder for further assertions
-
empty()
to this method.