mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/controller/TestControllerMgrImpl.java
@Test
    public void testCleanupHelperCleanupResponse()
    {
        //controllerId
        int contNew = 6431;                    
        RemoteChannel channel = addChannelMockHelper(contNew);//mock channel lookup
        
        //mock addition of controller
        m_ChannelHelper.handleEvent(createBasicChannelUpdatedEvent(channel, contNew));
        
        ControllerModel model = m_SUT.getController(contNew);        
        assertThat(model.isReady(), is(false));
        
        //mock cleanup response for new controller
        mockCleanupMessage(contNew, EventAdminMessageType.CleanupResponse); 
        
        //mock cleanup response for unknown controller
        mockCleanupMessage(9999, EventAdminMessageType.CleanupResponse); 
        
        //model is now ready to send and receive messages
        assertThat(model.isReady(), is(true));
        
        //verify 4 request messages are queued (corresponds to known controller)
        //one system info, one get system mode request, one event registration request, one capabilities request
        verify(m_MessageWrapper, times(4)).queue(eq(contNew), Mockito.any(RemoteEventRegistrationHandler.class));
    }
/**
     * Test event handling.
     * 
     * Verify that controller information is updated.
     */
Test event handling.

Verify that controller information is updated.
Test event handling . Verify that controller information is updated .
@Test
    public void testCleanupHelperCleanupResponse()
    {
        int contNew = 6431;                    
        RemoteChannel channel = addChannelMockHelper(contNew);
        m_ChannelHelper.handleEvent(createBasicChannelUpdatedEvent(channel, contNew));
        ControllerModel model = m_SUT.getController(contNew);        
        assertThat(model.isReady(), is(false));
        mockCleanupMessage(contNew, EventAdminMessageType.CleanupResponse); 
        mockCleanupMessage(9999, EventAdminMessageType.CleanupResponse); 
        assertThat(model.isReady(), is(true));
        verify(m_MessageWrapper, times(4)).queue(eq(contNew), Mockito.any(RemoteEventRegistrationHandler.class));
    }
@ Test public void testCleanupHelperCleanupResponse ( ) { int contNew = 6431 ; RemoteChannel channel = addChannelMockHelper ( contNew ) ; m_ChannelHelper . handleEvent ( createBasicChannelUpdatedEvent ( channel , contNew ) ) ; ControllerModel model = m_SUT . getController ( contNew ) ; assertThat ( model . isReady ( ) , is ( false ) ) ; mockCleanupMessage ( contNew , EventAdminMessageType . CleanupResponse ) ; mockCleanupMessage ( 9999 , EventAdminMessageType . CleanupResponse ) ; assertThat ( model . isReady ( ) , is ( true ) ) ; verify ( m_MessageWrapper , times ( 4 ) ) . queue ( eq ( contNew ) , Mockito . any ( RemoteEventRegistrationHandler . class ) ) ; }
Test event handling.
Test event handling .
//controllerId //mock channel lookup //mock addition of controller //mock cleanup response for new controller //mock cleanup response for unknown controller //model is now ready to send and receive messages //verify 4 request messages are queued (corresponds to known controller) //one system info, one get system mode request, one event registration request, one capabilities request