mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestAddCommsMessageControllerImpl.java
@Test
    public void testSubmitNewCommsStackRequestLinkLayer()
    {
        //physical link uuid
        UUID uuid_phys = UUID.randomUUID();
        //get a model and un-set trans info 
        CommsStackCreationModel model = getCompleteModel(PhysicalLinkTypeEnum.I_2_C);
        model.setNewTransportName(null);
        model.setSelectedTransportLayerType(null);
        
        //comms service  behavior
        when(m_CommsMgr.getPhysicalUuidByName("fizzyPhys", 0)).thenReturn(uuid_phys);
        
        m_SUT.submitNewCommsStackRequest(0, model);
        
        //capture the message sent and built message for the transport layer
        ArgumentCaptor<CreateLinkLayerRequestData> linkMessageCap = 
                ArgumentCaptor.forClass(CreateLinkLayerRequestData.class);
        verify(m_MessageFactory).createCustomCommsMessage(
                eq(CustomCommsMessageType.CreateLinkLayerRequest), linkMessageCap.capture());
        
        //verify  no link handler is created for trans
        verify(m_CommsMgr, never()).createLinkLayerHandler(Mockito.any(CreateTransportLayerRequestData.Builder.class));
        
        //capture handler value, should be null
        ArgumentCaptor<ResponseHandler> handlerCap = ArgumentCaptor.forClass(ResponseHandler.class);
        verify(m_MessageWrapper).queue(eq(0), handlerCap.capture());
        assertThat(handlerCap.getValue(), is(nullValue()));
        
        //inspect link layer captured message
        CreateLinkLayerRequestData linkRequest = linkMessageCap.getValue();
        assertThat(linkRequest.getLinkLayerProductType(), is("example.link.type"));
        assertThat(linkRequest.getLinkLayerName(), is("linkyLink"));
        assertThat(linkRequest.getPhysicalLinkUuid(), is(SharedMessageUtils.convertUUIDToProtoUUID(uuid_phys)));
    }
/**
     * Verify that when presented a model and controller ID, that a request to create a link layer
     * does not pull in transport layer information.
     */
Verify that when presented a model and controller ID, that a request to create a link layer
does not pull in transport layer information.
Verify that when presented a model and controller ID that a request to create a link layer does not pull in transport layer information .
@Test
    public void testSubmitNewCommsStackRequestLinkLayer()
    {
        UUID uuid_phys = UUID.randomUUID();
        CommsStackCreationModel model = getCompleteModel(PhysicalLinkTypeEnum.I_2_C);
        model.setNewTransportName(null);
        model.setSelectedTransportLayerType(null);
        when(m_CommsMgr.getPhysicalUuidByName("fizzyPhys", 0)).thenReturn(uuid_phys);
        m_SUT.submitNewCommsStackRequest(0, model);
        ArgumentCaptor<CreateLinkLayerRequestData> linkMessageCap = 
                ArgumentCaptor.forClass(CreateLinkLayerRequestData.class);
        verify(m_MessageFactory).createCustomCommsMessage(
                eq(CustomCommsMessageType.CreateLinkLayerRequest), linkMessageCap.capture());
        verify(m_CommsMgr, never()).createLinkLayerHandler(Mockito.any(CreateTransportLayerRequestData.Builder.class));
        ArgumentCaptor<ResponseHandler> handlerCap = ArgumentCaptor.forClass(ResponseHandler.class);
        verify(m_MessageWrapper).queue(eq(0), handlerCap.capture());
        assertThat(handlerCap.getValue(), is(nullValue()));
        CreateLinkLayerRequestData linkRequest = linkMessageCap.getValue();
        assertThat(linkRequest.getLinkLayerProductType(), is("example.link.type"));
        assertThat(linkRequest.getLinkLayerName(), is("linkyLink"));
        assertThat(linkRequest.getPhysicalLinkUuid(), is(SharedMessageUtils.convertUUIDToProtoUUID(uuid_phys)));
    }
@ Test public void testSubmitNewCommsStackRequestLinkLayer ( ) { UUID uuid_phys = UUID . randomUUID ( ) ; CommsStackCreationModel model = getCompleteModel ( PhysicalLinkTypeEnum . I_2_C ) ; model . setNewTransportName ( null ) ; model . setSelectedTransportLayerType ( null ) ; when ( m_CommsMgr . getPhysicalUuidByName ( "fizzyPhys" , 0 ) ) . thenReturn ( uuid_phys ) ; m_SUT . submitNewCommsStackRequest ( 0 , model ) ; ArgumentCaptor < CreateLinkLayerRequestData > linkMessageCap = ArgumentCaptor . forClass ( CreateLinkLayerRequestData . class ) ; verify ( m_MessageFactory ) . createCustomCommsMessage ( eq ( CustomCommsMessageType . CreateLinkLayerRequest ) , linkMessageCap . capture ( ) ) ; verify ( m_CommsMgr , never ( ) ) . createLinkLayerHandler ( Mockito . any ( CreateTransportLayerRequestData . Builder . class ) ) ; ArgumentCaptor < ResponseHandler > handlerCap = ArgumentCaptor . forClass ( ResponseHandler . class ) ; verify ( m_MessageWrapper ) . queue ( eq ( 0 ) , handlerCap . capture ( ) ) ; assertThat ( handlerCap . getValue ( ) , is ( nullValue ( ) ) ) ; CreateLinkLayerRequestData linkRequest = linkMessageCap . getValue ( ) ; assertThat ( linkRequest . getLinkLayerProductType ( ) , is ( "example.link.type" ) ) ; assertThat ( linkRequest . getLinkLayerName ( ) , is ( "linkyLink" ) ) ; assertThat ( linkRequest . getPhysicalLinkUuid ( ) , is ( SharedMessageUtils . convertUUIDToProtoUUID ( uuid_phys ) ) ) ; }
Verify that when presented a model and controller ID, that a request to create a link layer
 does not pull in transport layer information.
Verify that when presented a model and controller ID that a request to create a link layer does not pull in transport layer information .
//physical link uuid //get a model and un-set trans info  //comms service  behavior //capture the message sent and built message for the transport layer //verify  no link handler is created for trans //capture handler value, should be null //inspect link layer captured message