mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestAddCommsMessageControllerImpl.java
@Test
    public void testSubmitNewCommsStackRequestForPhysicalLinkI2C()
    {
        final PhysicalLinkCapabilities physCaps = mock(PhysicalLinkCapabilities.class);
        when(physCaps.getLinkType()).thenReturn(PhysicalLinkTypeEnum.I_2_C);
        //get a model and set force phys to true
        CommsStackCreationModel model = getCompleteModel(PhysicalLinkTypeEnum.I_2_C);
        model.setForceAdd(true);
        
        m_SUT.submitNewCommsStackRequest(0, model);
        
        //capture the message sent
        ArgumentCaptor<CreatePhysicalLinkRequestData> physMessageCap = 
                ArgumentCaptor.forClass(CreatePhysicalLinkRequestData.class);
        verify(m_MessageFactory).createCustomCommsMessage(
                eq(CustomCommsMessageType.CreatePhysicalLinkRequest), physMessageCap.capture());

        verify(m_MessageWrapper).queue(0, null);
        
        //inspect physical link layer captured message
        CreatePhysicalLinkRequestData plinkRequest = physMessageCap.getValue();
        assertThat(plinkRequest.getPhysicalLinkType(), 
            is(CustomCommTypesGen.PhysicalLinkType.Enum.I_2_C));
        assertThat(plinkRequest.getPhysicalLinkName(), is("tobyPhys"));
    }
/**
     * Verify that presented a model to force create a physical and controller ID, 
     * that the request to create the physical link is sent.
     */
Verify that presented a model to force create a physical and controller ID,
that the request to create the physical link is sent.
Verify that presented a model to force create a physical and controller ID that the request to create the physical link is sent .
@Test
    public void testSubmitNewCommsStackRequestForPhysicalLinkI2C()
    {
        final PhysicalLinkCapabilities physCaps = mock(PhysicalLinkCapabilities.class);
        when(physCaps.getLinkType()).thenReturn(PhysicalLinkTypeEnum.I_2_C);
        CommsStackCreationModel model = getCompleteModel(PhysicalLinkTypeEnum.I_2_C);
        model.setForceAdd(true);
        m_SUT.submitNewCommsStackRequest(0, model);
        ArgumentCaptor<CreatePhysicalLinkRequestData> physMessageCap = 
                ArgumentCaptor.forClass(CreatePhysicalLinkRequestData.class);
        verify(m_MessageFactory).createCustomCommsMessage(
                eq(CustomCommsMessageType.CreatePhysicalLinkRequest), physMessageCap.capture());
        verify(m_MessageWrapper).queue(0, null);
        CreatePhysicalLinkRequestData plinkRequest = physMessageCap.getValue();
        assertThat(plinkRequest.getPhysicalLinkType(), 
            is(CustomCommTypesGen.PhysicalLinkType.Enum.I_2_C));
        assertThat(plinkRequest.getPhysicalLinkName(), is("tobyPhys"));
    }
@ Test public void testSubmitNewCommsStackRequestForPhysicalLinkI2C ( ) { final PhysicalLinkCapabilities physCaps = mock ( PhysicalLinkCapabilities . class ) ; when ( physCaps . getLinkType ( ) ) . thenReturn ( PhysicalLinkTypeEnum . I_2_C ) ; CommsStackCreationModel model = getCompleteModel ( PhysicalLinkTypeEnum . I_2_C ) ; model . setForceAdd ( true ) ; m_SUT . submitNewCommsStackRequest ( 0 , model ) ; ArgumentCaptor < CreatePhysicalLinkRequestData > physMessageCap = ArgumentCaptor . forClass ( CreatePhysicalLinkRequestData . class ) ; verify ( m_MessageFactory ) . createCustomCommsMessage ( eq ( CustomCommsMessageType . CreatePhysicalLinkRequest ) , physMessageCap . capture ( ) ) ; verify ( m_MessageWrapper ) . queue ( 0 , null ) ; CreatePhysicalLinkRequestData plinkRequest = physMessageCap . getValue ( ) ; assertThat ( plinkRequest . getPhysicalLinkType ( ) , is ( CustomCommTypesGen . PhysicalLinkType . Enum . I_2_C ) ) ; assertThat ( plinkRequest . getPhysicalLinkName ( ) , is ( "tobyPhys" ) ) ; }
Verify that presented a model to force create a physical and controller ID,
 that the request to create the physical link is sent.
Verify that presented a model to force create a physical and controller ID that the request to create the physical link is sent .
//get a model and set force phys to true //capture the message sent //inspect physical link layer captured message