Search in sources :

Example 1 with DisabledNotificationConfig

use of org.mule.runtime.config.internal.NotificationConfig.DisabledNotificationConfig in project mule by mulesoft.

the class ServerNotificationManagerConfiguratorTestCase method compliantDisabledNotificationByInterface.

@Test
public void compliantDisabledNotificationByInterface() throws InitialisationException {
    doReturn(singletonList((NotificationsProvider) () -> singletonMap("test:COMPLIANT", new Pair(CompliantNotification.class, CompliantNotificationListener.class)))).when(registry).lookupAllByType(NotificationsProvider.class);
    final DisabledNotificationConfig disableNotificationConfig = new DisabledNotificationConfig();
    disableNotificationConfig.setInterfaceClass(CompliantNotificationListener.class);
    configurator.setDisabledNotifications(singletonList(disableNotificationConfig));
    configurator.initialise();
    verify(notificationManager).disableInterface(CompliantNotificationListener.class);
}
Also used : DisabledNotificationConfig(org.mule.runtime.config.internal.NotificationConfig.DisabledNotificationConfig) NotificationsProvider(org.mule.runtime.core.api.context.notification.NotificationsProvider) Pair(org.mule.runtime.api.util.Pair) Test(org.junit.Test)

Example 2 with DisabledNotificationConfig

use of org.mule.runtime.config.internal.NotificationConfig.DisabledNotificationConfig in project mule by mulesoft.

the class ServerNotificationManagerConfiguratorTestCase method compliantDisabledNotificationByEventClass.

@Test
public void compliantDisabledNotificationByEventClass() throws InitialisationException {
    doReturn(singletonList((NotificationsProvider) () -> singletonMap("test:COMPLIANT", new Pair(CompliantNotification.class, CompliantNotificationListener.class)))).when(registry).lookupAllByType(NotificationsProvider.class);
    final DisabledNotificationConfig disableNotificationConfig = new DisabledNotificationConfig();
    disableNotificationConfig.setEventClass(CompliantNotification.class);
    configurator.setDisabledNotifications(singletonList(disableNotificationConfig));
    configurator.initialise();
    verify(notificationManager).disableType(CompliantNotification.class);
}
Also used : DisabledNotificationConfig(org.mule.runtime.config.internal.NotificationConfig.DisabledNotificationConfig) NotificationsProvider(org.mule.runtime.core.api.context.notification.NotificationsProvider) Pair(org.mule.runtime.api.util.Pair) Test(org.junit.Test)

Example 3 with DisabledNotificationConfig

use of org.mule.runtime.config.internal.NotificationConfig.DisabledNotificationConfig in project mule by mulesoft.

the class ServerNotificationManagerConfiguratorTestCase method compliantDisabledNotificationByEventName.

@Test
public void compliantDisabledNotificationByEventName() throws InitialisationException {
    doReturn(singletonList((NotificationsProvider) () -> singletonMap("test:COMPLIANT", new Pair(CompliantNotification.class, CompliantNotificationListener.class)))).when(registry).lookupAllByType(NotificationsProvider.class);
    final DisabledNotificationConfig disableNotificationConfig = new DisabledNotificationConfig();
    disableNotificationConfig.setEventName("test:COMPLIANT");
    configurator.setDisabledNotifications(singletonList(disableNotificationConfig));
    configurator.initialise();
    verify(notificationManager).disableType(CompliantNotification.class);
}
Also used : DisabledNotificationConfig(org.mule.runtime.config.internal.NotificationConfig.DisabledNotificationConfig) NotificationsProvider(org.mule.runtime.core.api.context.notification.NotificationsProvider) Pair(org.mule.runtime.api.util.Pair) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 Pair (org.mule.runtime.api.util.Pair)3 DisabledNotificationConfig (org.mule.runtime.config.internal.NotificationConfig.DisabledNotificationConfig)3 NotificationsProvider (org.mule.runtime.core.api.context.notification.NotificationsProvider)3