mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/ccomms/TestTransportLayerMessageService.java
@Test
    public void testRemoveTransportLayer() throws IOException, FactoryException
    {
        DeleteRequestData request = DeleteRequestData.newBuilder()
                .setTransportLayerUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        
        TransportLayerNamespace ccommMessage = TransportLayerNamespace.newBuilder()
                .setType(TransportLayerMessageType.DeleteRequest)
                .setData(request.toByteString())
                .build();
        
        TerraHarvestPayload payload = createPayload(ccommMessage);
        TerraHarvestMessage message = createTransportLayerMessage(ccommMessage);
        
        // mock the channel the message came from
        RemoteChannel channel = mock(RemoteChannel.class);
        
        // mock transport layer
        TransportLayer transportLayer = mock(TransportLayer.class);
        when(transportLayer.getUuid()).thenReturn(testUuid);
        
        List<TransportLayer> transportList = new ArrayList<TransportLayer>();
        transportList.add(transportLayer);
        
        when(m_CustomCommsService.getTransportLayers()).thenReturn(transportList);
        
        m_SUT.handleMessage(message, payload, channel);
        
        // verify remove transport layer was called
        verify(transportLayer).delete();
        
        Message testMessage = null;
        
        verify(m_MessageFactory).createTransportLayerResponseMessage(eq(message), 
                eq(TransportLayerMessageType.DeleteResponse), eq(testMessage));
        verify(m_ResponseWrapper).queue(channel);
    }
/**
     * Verify that the core service is requested to remove a transport layer, verify event posted for request
     * message, verify event property request in the posted event is the correct key 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 transport layer, verify event posted for request
message, verify event property request in the posted event is the correct key 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 transport layer verify event posted for request message verify event property request in the posted event is the correct key 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 testRemoveTransportLayer() throws IOException, FactoryException
    {
        DeleteRequestData request = DeleteRequestData.newBuilder()
                .setTransportLayerUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        TransportLayerNamespace ccommMessage = TransportLayerNamespace.newBuilder()
                .setType(TransportLayerMessageType.DeleteRequest)
                .setData(request.toByteString())
                .build();
        TerraHarvestPayload payload = createPayload(ccommMessage);
        TerraHarvestMessage message = createTransportLayerMessage(ccommMessage);
        RemoteChannel channel = mock(RemoteChannel.class);
        TransportLayer transportLayer = mock(TransportLayer.class);
        when(transportLayer.getUuid()).thenReturn(testUuid);
        List<TransportLayer> transportList = new ArrayList<TransportLayer>();
        transportList.add(transportLayer);
        when(m_CustomCommsService.getTransportLayers()).thenReturn(transportList);
        m_SUT.handleMessage(message, payload, channel);
        verify(transportLayer).delete();
        Message testMessage = null;
        verify(m_MessageFactory).createTransportLayerResponseMessage(eq(message), 
                eq(TransportLayerMessageType.DeleteResponse), eq(testMessage));
        verify(m_ResponseWrapper).queue(channel);
    }
@ Test public void testRemoveTransportLayer ( ) throws IOException , FactoryException { DeleteRequestData request = DeleteRequestData . newBuilder ( ) . setTransportLayerUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( testUuid ) ) . build ( ) ; TransportLayerNamespace ccommMessage = TransportLayerNamespace . newBuilder ( ) . setType ( TransportLayerMessageType . DeleteRequest ) . setData ( request . toByteString ( ) ) . build ( ) ; TerraHarvestPayload payload = createPayload ( ccommMessage ) ; TerraHarvestMessage message = createTransportLayerMessage ( ccommMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; TransportLayer transportLayer = mock ( TransportLayer . class ) ; when ( transportLayer . getUuid ( ) ) . thenReturn ( testUuid ) ; List < TransportLayer > transportList = new ArrayList < TransportLayer > ( ) ; transportList . add ( transportLayer ) ; when ( m_CustomCommsService . getTransportLayers ( ) ) . thenReturn ( transportList ) ; m_SUT . handleMessage ( message , payload , channel ) ; verify ( transportLayer ) . delete ( ) ; Message testMessage = null ; verify ( m_MessageFactory ) . createTransportLayerResponseMessage ( eq ( message ) , eq ( TransportLayerMessageType . DeleteResponse ) , eq ( testMessage ) ) ; verify ( m_ResponseWrapper ) . queue ( channel ) ; }
Verify that the core service is requested to remove a transport layer, verify event posted for request
 message, verify event property request in the posted event is the correct key 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 transport layer verify event posted for request message verify event property request in the posted event is the correct key 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 // mock transport layer // verify remove transport layer was called