mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/channel/TestChannelEventWrapper.java
@SuppressWarnings({"unchecked", "rawtypes"})
    @Test
    public void testInitAndCleanup()
    {
        ArgumentCaptor<Dictionary> propCaptor = ArgumentCaptor.forClass(Dictionary.class);
        
        m_SUT.init();
        
        verify(m_BundleContext).registerService(eq(EventHandler.class), 
                Mockito.any(EventHandler.class), propCaptor.capture());
        
        Dictionary<String, Object> props = propCaptor.getValue();
        
        assertThat(props.size(), is(1));
        
        String[] array = (String[])props.get(EventConstants.EVENT_TOPIC);
        assertThat(array.length, is(2));
        
        assertThat(array[0], is(RemoteChannelLookup.TOPIC_CHANNEL_UPDATED));
        assertThat(array[1], is(RemoteChannelLookup.TOPIC_CHANNEL_REMOVED));
        
        m_SUT.cleanup();
        
        verify(m_ServiceRegistration).unregister();
        
    }
/**
     * Verify init and cleanup register and unregister for event admin service.
     */
Verify init and cleanup register and unregister for event admin service.
Verify init and cleanup register and unregister for event admin service .
@SuppressWarnings({"unchecked", "rawtypes"})
    @Test
    public void testInitAndCleanup()
    {
        ArgumentCaptor<Dictionary> propCaptor = ArgumentCaptor.forClass(Dictionary.class);
        m_SUT.init();
        verify(m_BundleContext).registerService(eq(EventHandler.class), 
                Mockito.any(EventHandler.class), propCaptor.capture());
        Dictionary<String, Object> props = propCaptor.getValue();
        assertThat(props.size(), is(1));
        String[] array = (String[])props.get(EventConstants.EVENT_TOPIC);
        assertThat(array.length, is(2));
        assertThat(array[0], is(RemoteChannelLookup.TOPIC_CHANNEL_UPDATED));
        assertThat(array[1], is(RemoteChannelLookup.TOPIC_CHANNEL_REMOVED));
        m_SUT.cleanup();
        verify(m_ServiceRegistration).unregister();
    }
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) @ Test public void testInitAndCleanup ( ) { ArgumentCaptor < Dictionary > propCaptor = ArgumentCaptor . forClass ( Dictionary . class ) ; m_SUT . init ( ) ; verify ( m_BundleContext ) . registerService ( eq ( EventHandler . class ) , Mockito . any ( EventHandler . class ) , propCaptor . capture ( ) ) ; Dictionary < String , Object > props = propCaptor . getValue ( ) ; assertThat ( props . size ( ) , is ( 1 ) ) ; String [ ] array = ( String [ ] ) props . get ( EventConstants . EVENT_TOPIC ) ; assertThat ( array . length , is ( 2 ) ) ; assertThat ( array [ 0 ] , is ( RemoteChannelLookup . TOPIC_CHANNEL_UPDATED ) ) ; assertThat ( array [ 1 ] , is ( RemoteChannelLookup . TOPIC_CHANNEL_REMOVED ) ) ; m_SUT . cleanup ( ) ; verify ( m_ServiceRegistration ) . unregister ( ) ; }
Verify init and cleanup register and unregister for event admin service.
Verify init and cleanup register and unregister for event admin service .