Interface PAssert.SingletonAssert<T>
-
- Enclosing class:
- PAssert
public static interface PAssert.SingletonAssert<T>
Builder interface for assertions applicable to a single value.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PAssert.SingletonAssert<T>
inEarlyPane(BoundedWindow window)
Creates a newPAssert.SingletonAssert
like this one, but with the assertion restricted to only run on the provided window, running the checker only on early panes for each key.PAssert.SingletonAssert<T>
inFinalPane(BoundedWindow window)
Creates a newPAssert.SingletonAssert
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.SingletonAssert<T>
inLatePane(BoundedWindow window)
Creates a newPAssert.SingletonAssert
with the assertion restricted to only run on the provided window, running the checker only on late panes for each key.PAssert.SingletonAssert<T>
inOnlyPane(BoundedWindow window)
Creates a newPAssert.SingletonAssert
like this one, but with the assertion restricted to only run on the provided window.PAssert.SingletonAssert<T>
inOnTimePane(BoundedWindow window)
Creates a newPAssert.SingletonAssert
like this one, but with the assertion restricted to only run on the provided window, running the checker only on the on-time pane for each key.PAssert.SingletonAssert<T>
inWindow(BoundedWindow window)
Creates a newPAssert.SingletonAssert
like this one, but with the assertion restricted to only run on the provided window.PAssert.SingletonAssert<T>
isEqualTo(T expected)
Asserts that the value in question is equal to the provided value, according toObject.equals(java.lang.Object)
.PAssert.SingletonAssert<T>
notEqualTo(T notExpected)
Asserts that the value in question is not equal to the provided value, according toObject.equals(java.lang.Object)
.PAssert.SingletonAssert<T>
satisfies(SerializableFunction<T,java.lang.Void> checkerFn)
Applies the provided checking function (presumably containing assertions) to the value in question.
-
-
-
Method Detail
-
inWindow
PAssert.SingletonAssert<T> inWindow(BoundedWindow window)
Creates a newPAssert.SingletonAssert
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.SingletonAssert
like this one but with the assertion only applied to the specified window.
-
inOnlyPane
PAssert.SingletonAssert<T> inOnlyPane(BoundedWindow window)
Creates a newPAssert.SingletonAssert
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.SingletonAssert
like this one but with the assertion only applied to the specified window.
-
inFinalPane
PAssert.SingletonAssert<T> inFinalPane(BoundedWindow window)
Creates a newPAssert.SingletonAssert
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.SingletonAssert
like this one but with the assertion only applied to the specified window.
-
inOnTimePane
PAssert.SingletonAssert<T> inOnTimePane(BoundedWindow window)
Creates a newPAssert.SingletonAssert
like this one, but with the assertion restricted to only run on the provided window, running the checker only on the on-time pane for each key.- Returns:
- a new
PAssert.SingletonAssert
like this one but with the assertion only applied to the specified window.
-
inEarlyPane
PAssert.SingletonAssert<T> inEarlyPane(BoundedWindow window)
Creates a newPAssert.SingletonAssert
like this one, but with the assertion restricted to only run on the provided window, running the checker only on early panes for each key.- Returns:
- a new
PAssert.SingletonAssert
like this one but with the assertion only applied to the specified window.
-
inLatePane
PAssert.SingletonAssert<T> inLatePane(BoundedWindow window)
Creates a newPAssert.SingletonAssert
with the assertion restricted to only run on the provided window, running the checker only on late panes for each key.- Returns:
- a new
PAssert.SingletonAssert
like this one but with the assertion only applied to the specified window.
-
isEqualTo
PAssert.SingletonAssert<T> isEqualTo(T expected)
Asserts that the value in question is equal to the provided value, according toObject.equals(java.lang.Object)
.- Returns:
- the same
PAssert.SingletonAssert
builder for further assertions
-
notEqualTo
PAssert.SingletonAssert<T> notEqualTo(T notExpected)
Asserts that the value in question is not equal to the provided value, according toObject.equals(java.lang.Object)
.- Returns:
- the same
PAssert.SingletonAssert
builder for further assertions
-
satisfies
PAssert.SingletonAssert<T> satisfies(SerializableFunction<T,java.lang.Void> checkerFn)
Applies the provided checking function (presumably containing assertions) to the value in question.- Returns:
- the same
PAssert.SingletonAssert
builder for further assertions
-
-