Interface NotificationAccess


public interface NotificationAccess

Use the NotificationAccess to get information about notifications during a test.

To use the NotificationAccess annotate your test class with either the IvyTest or IvyProcessTest annotation. Then add the NotificationAccess as a parameter to any Test, BeforeAll, BeforeEach, AfterEach, AfterAll method, or the constructor of the test class.

Example:


 @IvyTest
 class Test
 {
 @Test
 void test(NotificationAccess notifications)
 {
 var count = notifications.count();
 BusinessNotification.create().message().text("message").receivers().addUser("user").send();
 assertThat(notifications.count()).isEqualTo(count + 1);
 }
 }
 
See Also:
API:
This is a public API.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the current number of notifications present in the system database.
  • Method Details

    • count

      long count()

      Returns the current number of notifications present in the system database.

      Example:

      
       @Test
       void test(NotificationAccess notifications)
       {
       var count = notifications.count();
       BusinessNotification.create().message().text("message").receivers().addUser("user").send();
       assertThat(notifications.count()).isEqualTo(count + 1);
       }
       
      API:
      This public API is available in Java.