Class MessageListTester<T extends MessageList>
java.lang.Object
com.vaadin.testbench.unit.ComponentTester<T>
com.vaadin.flow.component.messages.MessageListTester<T>
- Type Parameters:
T
- component type
Tester for MessageList components.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetMessage
(int index) Get message in given index.Get all messages in list.getMessages
(String userName) Get all messages for a given userName.getMessages
(Instant start, Instant end) Get messages between given Instant (excluding).getMessagesAfter
(Instant start) Get messages after given Instant (excluding).getMessagesBefore
(Instant end) Get messages before given Instant (excluding).int
size()
Get amount of messages in the messageList.Methods inherited from class com.vaadin.testbench.unit.ComponentTester
ensureComponentIsUsable, ensureVisible, find, findAllByQuery, findByQuery, fireDomEvent, fireDomEvent, fireDomEvent, getComponent, getField, getField, getMethod, getMethod, isUsable, notUsableReasons, roundTrip, setModal
-
Constructor Details
-
MessageListTester
Wrap given component for testing.- Parameters:
component
- target component
-
-
Method Details
-
size
public int size()Get amount of messages in the messageList.- Returns:
- message count
-
getMessage
Get message in given index. index is 0 based.- Parameters:
index
- item index- Returns:
- message in index
- Throws:
IndexOutOfBoundsException
- – if the index is out of range (index < 0 || index >= size())
-
getMessages
Get all messages in list.- Returns:
- all available messages
-
getMessages
Get messages between given Instant (excluding).- Parameters:
start
- start timeend
- end time- Returns:
- messages falling between start an end time
-
getMessagesAfter
Get messages after given Instant (excluding).- Parameters:
start
- start time- Returns:
- messages after start time
-
getMessagesBefore
Get messages before given Instant (excluding).- Parameters:
end
- end time- Returns:
- messages before end time
-
getMessages
Get all messages for a given userName.- Parameters:
userName
- user to get messages for (nullable)- Returns:
- messages for user, for
null
messages without defined userName
-