mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/controller/TestControllerStatusDialogHelperImpl.java
@Test
    public void testUpdatedSystemStatus()
    {
        ControllerModel model = new ControllerModel(123, m_ControllerImageInterface);        
        
        //verify update to operational mode
        model.setOperatingMode(OperationMode.TEST_MODE);
        m_SUT.setController(model);
        m_SUT.updatedSystemStatus(OperationMode.OPERATIONAL_MODE.toString());
        
        ArgumentCaptor<Message> messageCaptor = ArgumentCaptor.forClass(Message.class);
        verify(m_MessageFactory).createBaseMessage(eq(BaseMessageType.SetOperationModeRequest), 
                messageCaptor.capture());
        verify(m_MessageWrapper).queue(eq(123), (ResponseHandler)eq(null));
        
        SetOperationModeRequestData data = (SetOperationModeRequestData)messageCaptor.getValue();
        assertThat(data.getMode(), is(BaseMessages.OperationMode.OPERATIONAL_MODE));
        
        //verify update to test mode
        model.setOperatingMode(OperationMode.OPERATIONAL_MODE);
        m_SUT.setController(model);
        m_SUT.updatedSystemStatus(OperationMode.TEST_MODE.toString());
        
        verify(m_MessageFactory, times(2)).createBaseMessage(eq(BaseMessageType.SetOperationModeRequest),
                messageCaptor.capture());
        verify(m_MessageWrapper, times(2)).queue(eq(123), (ResponseHandler)eq(null));
        
        data = (SetOperationModeRequestData)messageCaptor.getValue();
        assertThat(data.getMode(), is(BaseMessages.OperationMode.TEST_MODE));
    }
/**
     * Verify status update message is queued. 
     */
Verify status update message is queued.
Verify status update message is queued .
@Test
    public void testUpdatedSystemStatus()
    {
        ControllerModel model = new ControllerModel(123, m_ControllerImageInterface);        
        model.setOperatingMode(OperationMode.TEST_MODE);
        m_SUT.setController(model);
        m_SUT.updatedSystemStatus(OperationMode.OPERATIONAL_MODE.toString());
        ArgumentCaptor<Message> messageCaptor = ArgumentCaptor.forClass(Message.class);
        verify(m_MessageFactory).createBaseMessage(eq(BaseMessageType.SetOperationModeRequest), 
                messageCaptor.capture());
        verify(m_MessageWrapper).queue(eq(123), (ResponseHandler)eq(null));
        SetOperationModeRequestData data = (SetOperationModeRequestData)messageCaptor.getValue();
        assertThat(data.getMode(), is(BaseMessages.OperationMode.OPERATIONAL_MODE));
        model.setOperatingMode(OperationMode.OPERATIONAL_MODE);
        m_SUT.setController(model);
        m_SUT.updatedSystemStatus(OperationMode.TEST_MODE.toString());
        verify(m_MessageFactory, times(2)).createBaseMessage(eq(BaseMessageType.SetOperationModeRequest),
                messageCaptor.capture());
        verify(m_MessageWrapper, times(2)).queue(eq(123), (ResponseHandler)eq(null));
        data = (SetOperationModeRequestData)messageCaptor.getValue();
        assertThat(data.getMode(), is(BaseMessages.OperationMode.TEST_MODE));
    }
@ Test public void testUpdatedSystemStatus ( ) { ControllerModel model = new ControllerModel ( 123 , m_ControllerImageInterface ) ; model . setOperatingMode ( OperationMode . TEST_MODE ) ; m_SUT . setController ( model ) ; m_SUT . updatedSystemStatus ( OperationMode . OPERATIONAL_MODE . toString ( ) ) ; ArgumentCaptor < Message > messageCaptor = ArgumentCaptor . forClass ( Message . class ) ; verify ( m_MessageFactory ) . createBaseMessage ( eq ( BaseMessageType . SetOperationModeRequest ) , messageCaptor . capture ( ) ) ; verify ( m_MessageWrapper ) . queue ( eq ( 123 ) , ( ResponseHandler ) eq ( null ) ) ; SetOperationModeRequestData data = ( SetOperationModeRequestData ) messageCaptor . getValue ( ) ; assertThat ( data . getMode ( ) , is ( BaseMessages . OperationMode . OPERATIONAL_MODE ) ) ; model . setOperatingMode ( OperationMode . OPERATIONAL_MODE ) ; m_SUT . setController ( model ) ; m_SUT . updatedSystemStatus ( OperationMode . TEST_MODE . toString ( ) ) ; verify ( m_MessageFactory , times ( 2 ) ) . createBaseMessage ( eq ( BaseMessageType . SetOperationModeRequest ) , messageCaptor . capture ( ) ) ; verify ( m_MessageWrapper , times ( 2 ) ) . queue ( eq ( 123 ) , ( ResponseHandler ) eq ( null ) ) ; data = ( SetOperationModeRequestData ) messageCaptor . getValue ( ) ; assertThat ( data . getMode ( ) , is ( BaseMessages . OperationMode . TEST_MODE ) ) ; }
Verify status update message is queued.
Verify status update message is queued .
//verify update to operational mode //verify update to test mode