Class StreamAsserts
-
Method Summary
Modifier and TypeMethodDescriptionstatic StreamAssertsassertThatQueue(BlockingQueue<org.springframework.messaging.Message<?>> queue) Creates an instance ofStreamAssertsto assert the supplied queue.protected StringgetMessageTypes(Collection<org.springframework.messaging.Message<?>> messages) Concatenate the messages types to be displayed in the assertions.protected StringgetType(org.springframework.messaging.Message<?> message) Lookup for the message type in theMessageheader.has(int total) Assert that the queue of expectedMessageisempty, otherwise, fails.voidisEmpty()Assert that the queue of expectedMessageisempty, otherwise, fails.protected voidAssert thatexpectedandactualare equal.voidAssert that the suppliedclass typeis the same type of theMessage.voidAssert that the suppliedtypeis the same type of theMessage.voidAssert that the suppliedclass typeis the same types of theMessagein the queue.voidAssert that the suppliedclass typeis the same types of theMessagein the queue.
-
Method Details
-
assertThatQueue
public static StreamAsserts assertThatQueue(BlockingQueue<org.springframework.messaging.Message<?>> queue) Creates an instance ofStreamAssertsto assert the supplied queue.- Parameters:
queue- to be asserted.- Returns:
- instance of
StreamAsserts.
-
isEmpty
public void isEmpty()Assert that the queue of expectedMessageisempty, otherwise, fails. -
has
Assert that the queue of expectedMessageisempty, otherwise, fails.- Parameters:
total- of messages expected.- Returns:
- itself.
-
withType
Assert that the suppliedclass typeis the same type of theMessage.When supplied the
class typethe assertions considerer the class simple name as the message type to be expected.Note: When looking for a single type, only the first
Messagein the queue is considered.- Parameters:
type- class to be expected.
-
withType
Assert that the suppliedtypeis the same type of theMessage.Note: When looking for a single type, only the first
Messagein the queue is considered.- Parameters:
type- to be expected.
-
withTypes
Assert that the suppliedclass typeis the same types of theMessagein the queue.When supplied the
class typethe assertions considerer the class simple name as the message type to be expected.Note: The assertion expect the supplied types still in the same order as the
Messagewas published in the queue.- Parameters:
types- to be expected.
-
withTypes
Assert that the suppliedclass typeis the same types of theMessagein the queue.Note: The assertion expect the supplied types still in the same order as the
Messagewas published in the queue.- Parameters:
types- to be expected.
-
validate
Assert thatexpectedandactualare equal.If both are
null, they are considered equal. -
getType
Lookup for the message type in theMessageheader.Note: the header type obeys the following sequence of headers to lookup for:
- cloudEvents:type
- type
- Parameters:
message- to be verified.- Returns:
- the type specified in the
Messageheader.
-
getMessageTypes
Concatenate the messages types to be displayed in the assertions.- Parameters:
messages- to lookup for the types.- Returns:
- the concatenated types found in the queue.
-