mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/mp/TestCurrentMissionMgrImpl.java
@Test
    public void testRemoteEventProgramAddedEvent()
    {
        //initialize m_SUT. Will post a push update
        assertThat(initCurrentMissionModels(123), is(3));
        
        Event programAdded = mockARemoteEvent(123, MissionProgramManager.TOPIC_PROGRAM_ADDED, 
                "Mission 4", new HashMap<String, Object>());
        
        m_RemoteEventHelper.handleEvent(programAdded);
        
        ArgumentCaptor<Message> msgCaptor = ArgumentCaptor.forClass(Message.class);
        
        //init function above causes the first GetProgramInformationRequest message. We are just concerned 
        //with the second message
        verify(m_MessageFactory, times(2)).createMissionProgrammingMessage(eq(MissionProgrammingMessageType.
                GetProgramInformationRequest), msgCaptor.capture());
        verify(m_MessageWrapper, times(2)).queue(eq(123), (ResponseHandler)eq(null));
        
        GetProgramInformationRequestData requestMsg = (GetProgramInformationRequestData)
                msgCaptor.getAllValues().get(1);
        
        assertThat(requestMsg.getMissionNameCount(), is(1));
        assertThat(requestMsg.getMissionName(0), is("Mission 4"));
    }
/**
     * Verify program added event is properly handled.
     */
Verify program added event is properly handled.
Verify program added event is properly handled .
@Test
    public void testRemoteEventProgramAddedEvent()
    {
        assertThat(initCurrentMissionModels(123), is(3));
        Event programAdded = mockARemoteEvent(123, MissionProgramManager.TOPIC_PROGRAM_ADDED, 
                "Mission 4", new HashMap<String, Object>());
        m_RemoteEventHelper.handleEvent(programAdded);
        ArgumentCaptor<Message> msgCaptor = ArgumentCaptor.forClass(Message.class);
        verify(m_MessageFactory, times(2)).createMissionProgrammingMessage(eq(MissionProgrammingMessageType.
                GetProgramInformationRequest), msgCaptor.capture());
        verify(m_MessageWrapper, times(2)).queue(eq(123), (ResponseHandler)eq(null));
        GetProgramInformationRequestData requestMsg = (GetProgramInformationRequestData)
                msgCaptor.getAllValues().get(1);
        assertThat(requestMsg.getMissionNameCount(), is(1));
        assertThat(requestMsg.getMissionName(0), is("Mission 4"));
    }
@ Test public void testRemoteEventProgramAddedEvent ( ) { assertThat ( initCurrentMissionModels ( 123 ) , is ( 3 ) ) ; Event programAdded = mockARemoteEvent ( 123 , MissionProgramManager . TOPIC_PROGRAM_ADDED , "Mission 4" , new HashMap < String , Object > ( ) ) ; m_RemoteEventHelper . handleEvent ( programAdded ) ; ArgumentCaptor < Message > msgCaptor = ArgumentCaptor . forClass ( Message . class ) ; verify ( m_MessageFactory , times ( 2 ) ) . createMissionProgrammingMessage ( eq ( MissionProgrammingMessageType . GetProgramInformationRequest ) , msgCaptor . capture ( ) ) ; verify ( m_MessageWrapper , times ( 2 ) ) . queue ( eq ( 123 ) , ( ResponseHandler ) eq ( null ) ) ; GetProgramInformationRequestData requestMsg = ( GetProgramInformationRequestData ) msgCaptor . getAllValues ( ) . get ( 1 ) ; assertThat ( requestMsg . getMissionNameCount ( ) , is ( 1 ) ) ; assertThat ( requestMsg . getMissionName ( 0 ) , is ( "Mission 4" ) ) ; }
Verify program added event is properly handled.
Verify program added event is properly handled .
//initialize m_SUT. Will post a push update //init function above causes the first GetProgramInformationRequest message. We are just concerned  //with the second message