mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsMgrImpl.java
@Test
    public void testGetLayerNameResponse()
    {
        Event event = mockGetLayersResponse(systemId1, "transport");
        Event event2 = mockGetLayerNameResponse(systemId1, CommType.TransportLayer, uuid1, "transyTrans");
        
        m_EventHelperComms.handleEvent(event); 
        List<CommsLayerBaseModel> transModels = m_SUT.getTransportsAsync(systemId1);
        assertThat(transModels.size(), is(1));
        
        m_EventHelperComms.handleEvent(event2);
        assertThat(transModels.get(0).getName(), is("transyTrans"));     
        
        ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
        //verify push event
        verify(m_EventAdmin, times(2)).postEvent(captor.capture());
        assertThat(captor.getValue().getTopic(), is(CommsMgr.TOPIC_COMMS_LAYER_UPDATED));  
    }
/**
     * Test setting of layer name.
     * Verify name of a layer has been set correctly.  
     */
Test setting of layer name.
Verify name of a layer has been set correctly.
Test setting of layer name . Verify name of a layer has been set correctly .
@Test
    public void testGetLayerNameResponse()
    {
        Event event = mockGetLayersResponse(systemId1, "transport");
        Event event2 = mockGetLayerNameResponse(systemId1, CommType.TransportLayer, uuid1, "transyTrans");
        m_EventHelperComms.handleEvent(event); 
        List<CommsLayerBaseModel> transModels = m_SUT.getTransportsAsync(systemId1);
        assertThat(transModels.size(), is(1));
        m_EventHelperComms.handleEvent(event2);
        assertThat(transModels.get(0).getName(), is("transyTrans"));     
        ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin, times(2)).postEvent(captor.capture());
        assertThat(captor.getValue().getTopic(), is(CommsMgr.TOPIC_COMMS_LAYER_UPDATED));  
    }
@ Test public void testGetLayerNameResponse ( ) { Event event = mockGetLayersResponse ( systemId1 , "transport" ) ; Event event2 = mockGetLayerNameResponse ( systemId1 , CommType . TransportLayer , uuid1 , "transyTrans" ) ; m_EventHelperComms . handleEvent ( event ) ; List < CommsLayerBaseModel > transModels = m_SUT . getTransportsAsync ( systemId1 ) ; assertThat ( transModels . size ( ) , is ( 1 ) ) ; m_EventHelperComms . handleEvent ( event2 ) ; assertThat ( transModels . get ( 0 ) . getName ( ) , is ( "transyTrans" ) ) ; ArgumentCaptor < Event > captor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin , times ( 2 ) ) . postEvent ( captor . capture ( ) ) ; assertThat ( captor . getValue ( ) . getTopic ( ) , is ( CommsMgr . TOPIC_COMMS_LAYER_UPDATED ) ) ; }
Test setting of layer name.
Test setting of layer name .
//verify push event