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

public class MessageListTester<T extends MessageList> extends ComponentTester<T>
Tester for MessageList components.
  • Constructor Details

    • MessageListTester

      public MessageListTester(T component)
      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

      public MessageListItem getMessage(int index)
      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

      public List<MessageListItem> getMessages()
      Get all messages in list.
      Returns:
      all available messages
    • getMessages

      public List<MessageListItem> getMessages(Instant start, Instant end)
      Get messages between given Instant (excluding).
      Parameters:
      start - start time
      end - end time
      Returns:
      messages falling between start an end time
    • getMessagesAfter

      public List<MessageListItem> getMessagesAfter(Instant start)
      Get messages after given Instant (excluding).
      Parameters:
      start - start time
      Returns:
      messages after start time
    • getMessagesBefore

      public List<MessageListItem> getMessagesBefore(Instant end)
      Get messages before given Instant (excluding).
      Parameters:
      end - end time
      Returns:
      messages before end time
    • getMessages

      public List<MessageListItem> getMessages(String userName)
      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