mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageSenderImpl.java
@SuppressWarnings("unchecked")
    private void activateSetUp()
    {
        //mocks for registration
        BundleContext context = mock(BundleContext.class);
        m_HandlerReg = mock(ServiceRegistration.class);
        
        //activate component
        when(context.registerService(eq(EventHandler.class), Mockito.any(EventHandler.class), 
                Mockito.any(Dictionary.class))).thenReturn(m_HandlerReg);
        m_SUT.activate(context);
        ArgumentCaptor<EventHandler> captor = ArgumentCaptor.forClass(EventHandler.class);
        @SuppressWarnings("rawtypes")
        ArgumentCaptor<Dictionary> captorDict = ArgumentCaptor.forClass(Dictionary.class);
        verify(context).registerService(eq(EventHandler.class), captor.capture(), 
            captorDict.capture());
        
        assertThat((String)captorDict.getValue().get(EventConstants.EVENT_FILTER), is("(message.response=true)"));
        
        //enter mocks for the inner classes
        m_ResponseHandler = (ResponseEventHandler) captor.getAllValues().get(0);
        m_Handler = mock(ResponseHandler.class);
    }
/**
     * Setup the service registration and activate the component.
     * Verify that the service is registered.
     */
Setup the service registration and activate the component.
Verify that the service is registered.
Setup the service registration and activate the component . Verify that the service is registered .
@SuppressWarnings("unchecked")
    private void activateSetUp()
    {
        BundleContext context = mock(BundleContext.class);
        m_HandlerReg = mock(ServiceRegistration.class);
        when(context.registerService(eq(EventHandler.class), Mockito.any(EventHandler.class), 
                Mockito.any(Dictionary.class))).thenReturn(m_HandlerReg);
        m_SUT.activate(context);
        ArgumentCaptor<EventHandler> captor = ArgumentCaptor.forClass(EventHandler.class);
        @SuppressWarnings("rawtypes")
        ArgumentCaptor<Dictionary> captorDict = ArgumentCaptor.forClass(Dictionary.class);
        verify(context).registerService(eq(EventHandler.class), captor.capture(), 
            captorDict.capture());
        assertThat((String)captorDict.getValue().get(EventConstants.EVENT_FILTER), is("(message.response=true)"));
        m_ResponseHandler = (ResponseEventHandler) captor.getAllValues().get(0);
        m_Handler = mock(ResponseHandler.class);
    }
@ SuppressWarnings ( "unchecked" ) private void activateSetUp ( ) { BundleContext context = mock ( BundleContext . class ) ; m_HandlerReg = mock ( ServiceRegistration . class ) ; when ( context . registerService ( eq ( EventHandler . class ) , Mockito . any ( EventHandler . class ) , Mockito . any ( Dictionary . class ) ) ) . thenReturn ( m_HandlerReg ) ; m_SUT . activate ( context ) ; ArgumentCaptor < EventHandler > captor = ArgumentCaptor . forClass ( EventHandler . class ) ; @ SuppressWarnings ( "rawtypes" ) ArgumentCaptor < Dictionary > captorDict = ArgumentCaptor . forClass ( Dictionary . class ) ; verify ( context ) . registerService ( eq ( EventHandler . class ) , captor . capture ( ) , captorDict . capture ( ) ) ; assertThat ( ( String ) captorDict . getValue ( ) . get ( EventConstants . EVENT_FILTER ) , is ( "(message.response=true)" ) ) ; m_ResponseHandler = ( ResponseEventHandler ) captor . getAllValues ( ) . get ( 0 ) ; m_Handler = mock ( ResponseHandler . class ) ; }
Setup the service registration and activate the component.
Setup the service registration and activate the component .
//mocks for registration //activate component //enter mocks for the inner classes