mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/mp/TestMissionProgramMgrImpl.java
@Test
    public void testControllerAdded()
    {
        //the system id to use
        ControllerModel model = mock(ControllerModel.class);
        when(model.getId()).thenReturn(911);
        
        //active controller behavior
        when(m_ActiveController.isActiveControllerSet()).thenReturn(true);
        when(m_ActiveController.getActiveController()).thenReturn(model);

        m_SUT.requestSyncingOfTemplates(911);

        //verify the request for templates is sent
        verify(m_MessageFactory).createMissionProgrammingMessage(
            eq(MissionProgrammingMessageType.GetTemplatesRequest), Mockito.any(Message.class));
        verify(m_MessageWrapper).queue(eq(911), (ResponseHandler) eq(null));
        //verify that the request to get templates is made
        verify(m_MessageFactory).createMissionProgrammingMessage(MissionProgrammingMessageType.GetTemplatesRequest,
            null);
        verify(m_MessageWrapper).queue(eq(911), (ResponseHandler) eq(null));
    }
/**
     * Test receiving a controller added event.
     * 
     * Verify that the request for templates and remote events is sent.
     */
Test receiving a controller added event.

Verify that the request for templates and remote events is sent.
Test receiving a controller added event . Verify that the request for templates and remote events is sent .
@Test
    public void testControllerAdded()
    {
        ControllerModel model = mock(ControllerModel.class);
        when(model.getId()).thenReturn(911);
        when(m_ActiveController.isActiveControllerSet()).thenReturn(true);
        when(m_ActiveController.getActiveController()).thenReturn(model);
        m_SUT.requestSyncingOfTemplates(911);
        verify(m_MessageFactory).createMissionProgrammingMessage(
            eq(MissionProgrammingMessageType.GetTemplatesRequest), Mockito.any(Message.class));
        verify(m_MessageWrapper).queue(eq(911), (ResponseHandler) eq(null));
        verify(m_MessageFactory).createMissionProgrammingMessage(MissionProgrammingMessageType.GetTemplatesRequest,
            null);
        verify(m_MessageWrapper).queue(eq(911), (ResponseHandler) eq(null));
    }
@ Test public void testControllerAdded ( ) { ControllerModel model = mock ( ControllerModel . class ) ; when ( model . getId ( ) ) . thenReturn ( 911 ) ; when ( m_ActiveController . isActiveControllerSet ( ) ) . thenReturn ( true ) ; when ( m_ActiveController . getActiveController ( ) ) . thenReturn ( model ) ; m_SUT . requestSyncingOfTemplates ( 911 ) ; verify ( m_MessageFactory ) . createMissionProgrammingMessage ( eq ( MissionProgrammingMessageType . GetTemplatesRequest ) , Mockito . any ( Message . class ) ) ; verify ( m_MessageWrapper ) . queue ( eq ( 911 ) , ( ResponseHandler ) eq ( null ) ) ; verify ( m_MessageFactory ) . createMissionProgrammingMessage ( MissionProgrammingMessageType . GetTemplatesRequest , null ) ; verify ( m_MessageWrapper ) . queue ( eq ( 911 ) , ( ResponseHandler ) eq ( null ) ) ; }
Test receiving a controller added event.
Test receiving a controller added event .
//the system id to use //active controller behavior //verify the request for templates is sent //verify that the request to get templates is made