Search in sources :

Example 1 with MockNotificationHandler

use of org.infobip.mobile.messaging.notification.MockNotificationHandler in project mobile-messaging-sdk-android by infobip.

the class NotificationHandlerResolverTest method should_get_test_notification_handler.

@Test
public void should_get_test_notification_handler() throws InterruptedException {
    // Given
    given(moduleLoaderMock.loadModules(eq(NotificationHandler.class))).willReturn(new HashMap<String, NotificationHandler>() {

        {
            put(MockNotificationHandler.class.getName(), new MockNotificationHandler());
        }
    });
    MobileMessagingCore givenCore = new MobileMessagingCore(context, new AndroidBroadcaster(context), Executors.newSingleThreadExecutor(), moduleLoaderMock);
    // When
    NotificationHandler notificationHandler = givenCore.getNotificationHandler();
    // Then
    assertFalse(notificationHandler instanceof CoreNotificationHandler);
    assertTrue(notificationHandler instanceof MockNotificationHandler);
}
Also used : CoreNotificationHandler(org.infobip.mobile.messaging.notification.CoreNotificationHandler) MockNotificationHandler(org.infobip.mobile.messaging.notification.MockNotificationHandler) NotificationHandler(org.infobip.mobile.messaging.notification.NotificationHandler) CoreNotificationHandler(org.infobip.mobile.messaging.notification.CoreNotificationHandler) AndroidBroadcaster(org.infobip.mobile.messaging.platform.AndroidBroadcaster) MockNotificationHandler(org.infobip.mobile.messaging.notification.MockNotificationHandler) Test(org.junit.Test)

Aggregations

CoreNotificationHandler (org.infobip.mobile.messaging.notification.CoreNotificationHandler)1 MockNotificationHandler (org.infobip.mobile.messaging.notification.MockNotificationHandler)1 NotificationHandler (org.infobip.mobile.messaging.notification.NotificationHandler)1 AndroidBroadcaster (org.infobip.mobile.messaging.platform.AndroidBroadcaster)1 Test (org.junit.Test)1