Search in sources :

Example 1 with ApplicationListener

use of com.enonic.xp.app.ApplicationListener in project xp by enonic.

the class ApplicationListenerHubTest method testActivatedDeactivated.

@Test
void testActivatedDeactivated() {
    final Application app = mock(Application.class);
    ApplicationListenerHub dispatcher = new ApplicationListenerHub();
    final ApplicationListener listener = mock(ApplicationListener.class);
    dispatcher.addListener(listener);
    dispatcher.activated(app);
    dispatcher.deactivated(app);
    final InOrder inOrder = inOrder(listener);
    inOrder.verify(listener, times(1)).activated(same(app));
    inOrder.verify(listener, times(1)).deactivated(same(app));
}
Also used : InOrder(org.mockito.InOrder) ApplicationListener(com.enonic.xp.app.ApplicationListener) Application(com.enonic.xp.app.Application) Test(org.junit.jupiter.api.Test)

Aggregations

Application (com.enonic.xp.app.Application)1 ApplicationListener (com.enonic.xp.app.ApplicationListener)1 Test (org.junit.jupiter.api.Test)1 InOrder (org.mockito.InOrder)1