mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/ccomms/TestPhysicalLinkMessageService.java
@Test
    public void testRemovePhysicalLink() throws IOException, CCommException
    {
        DeleteRequestData request = DeleteRequestData.newBuilder()
                .setPhysicalLinkUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        
        PhysicalLinkNamespace ccommMessage = PhysicalLinkNamespace.newBuilder()
                .setType(PhysicalLinkMessageType.DeleteRequest)
                .setData(request.toByteString())
                .build();
        
        TerraHarvestPayload payload = createPayload(ccommMessage);
        TerraHarvestMessage message = createPhysicalLinkMessage(ccommMessage);
        
        // mock the channel the message came from
        RemoteChannel channel = mock(RemoteChannel.class);
        
        when(m_CustomCommsService.getPhysicalLinkName(testUuid)).thenReturn("Finn");
        
        m_SUT.handleMessage(message, payload, channel);
        
        // verify remove physical link was called
        verify(m_CustomCommsService).deletePhysicalLink("Finn");
        
        Message testMessage = null;
        
        verify(m_MessageFactory).createPhysicalLinkResponseMessage(eq(message), 
                eq(PhysicalLinkMessageType.DeleteResponse), eq(testMessage));
        verify(m_ResponseWrapper).queue(channel);
    }
/**
     * Verify that the core service is requested to remove a physical link, verify event posted for request
     * message, verify event property key in the posted event is the correct request for the message that was sent, also
     * capture argument values for the response message and make sure that the data sent is correct.
     */
Verify that the core service is requested to remove a physical link, verify event posted for request
message, verify event property key in the posted event is the correct request for the message that was sent, also
capture argument values for the response message and make sure that the data sent is correct.
Verify that the core service is requested to remove a physical link verify event posted for request message verify event property key in the posted event is the correct request for the message that was sent also capture argument values for the response message and make sure that the data sent is correct .
@Test
    public void testRemovePhysicalLink() throws IOException, CCommException
    {
        DeleteRequestData request = DeleteRequestData.newBuilder()
                .setPhysicalLinkUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        PhysicalLinkNamespace ccommMessage = PhysicalLinkNamespace.newBuilder()
                .setType(PhysicalLinkMessageType.DeleteRequest)
                .setData(request.toByteString())
                .build();
        TerraHarvestPayload payload = createPayload(ccommMessage);
        TerraHarvestMessage message = createPhysicalLinkMessage(ccommMessage);
        RemoteChannel channel = mock(RemoteChannel.class);
        when(m_CustomCommsService.getPhysicalLinkName(testUuid)).thenReturn("Finn");
        m_SUT.handleMessage(message, payload, channel);
        verify(m_CustomCommsService).deletePhysicalLink("Finn");
        Message testMessage = null;
        verify(m_MessageFactory).createPhysicalLinkResponseMessage(eq(message), 
                eq(PhysicalLinkMessageType.DeleteResponse), eq(testMessage));
        verify(m_ResponseWrapper).queue(channel);
    }
@ Test public void testRemovePhysicalLink ( ) throws IOException , CCommException { DeleteRequestData request = DeleteRequestData . newBuilder ( ) . setPhysicalLinkUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( testUuid ) ) . build ( ) ; PhysicalLinkNamespace ccommMessage = PhysicalLinkNamespace . newBuilder ( ) . setType ( PhysicalLinkMessageType . DeleteRequest ) . setData ( request . toByteString ( ) ) . build ( ) ; TerraHarvestPayload payload = createPayload ( ccommMessage ) ; TerraHarvestMessage message = createPhysicalLinkMessage ( ccommMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; when ( m_CustomCommsService . getPhysicalLinkName ( testUuid ) ) . thenReturn ( "Finn" ) ; m_SUT . handleMessage ( message , payload , channel ) ; verify ( m_CustomCommsService ) . deletePhysicalLink ( "Finn" ) ; Message testMessage = null ; verify ( m_MessageFactory ) . createPhysicalLinkResponseMessage ( eq ( message ) , eq ( PhysicalLinkMessageType . DeleteResponse ) , eq ( testMessage ) ) ; verify ( m_ResponseWrapper ) . queue ( channel ) ; }
Verify that the core service is requested to remove a physical link, verify event posted for request
 message, verify event property key in the posted event is the correct request for the message that was sent, also
 capture argument values for the response message and make sure that the data sent is correct.
Verify that the core service is requested to remove a physical link verify event posted for request message verify event property key in the posted event is the correct request for the message that was sent also capture argument values for the response message and make sure that the data sent is correct .
// mock the channel the message came from // verify remove physical link was called