mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/ccomms/TestLinkLayerMessageService.java
@Test
    public void testRemoveLinkLayer() throws IOException, FactoryException
    {
        DeleteRequestData request = DeleteRequestData.newBuilder()
                .setLinkLayerUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        
        LinkLayerNamespace ccommMessage = LinkLayerNamespace.newBuilder()
                .setType(LinkLayerMessageType.DeleteRequest)
                .setData(request.toByteString())
                .build();
        
        TerraHarvestPayload payload = createPayload(ccommMessage);
        TerraHarvestMessage message = createLinkLayerMessage(ccommMessage);
        
        // mock the channel the message came from
        RemoteChannel channel = mock(RemoteChannel.class);
        
        // mock link layer list
        LinkLayer lLayer = mock(LinkLayer.class);
        when(lLayer.getUuid()).thenReturn(testUuid);
        
        List<LinkLayer> listLayers = new ArrayList<LinkLayer>();
        listLayers.add(lLayer);
        
        when(m_CustomCommsService.getLinkLayers()).thenReturn(listLayers);
        
        m_SUT.handleMessage(message, payload, channel);
        
        // verify remove link layer was called
        verify(lLayer).delete();
        
        Message testMessage = null;
        
        verify(m_MessageFactory).createLinkLayerResponseMessage(eq(message), 
                eq(LinkLayerMessageType.DeleteResponse), eq(testMessage));
        verify(m_ResponseWrapper).queue(channel);
    }
/**
     * Verify that the core service is requested to remove a link layer, 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 link layer, 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 link layer 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 testRemoveLinkLayer() throws IOException, FactoryException
    {
        DeleteRequestData request = DeleteRequestData.newBuilder()
                .setLinkLayerUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        LinkLayerNamespace ccommMessage = LinkLayerNamespace.newBuilder()
                .setType(LinkLayerMessageType.DeleteRequest)
                .setData(request.toByteString())
                .build();
        TerraHarvestPayload payload = createPayload(ccommMessage);
        TerraHarvestMessage message = createLinkLayerMessage(ccommMessage);
        RemoteChannel channel = mock(RemoteChannel.class);
        LinkLayer lLayer = mock(LinkLayer.class);
        when(lLayer.getUuid()).thenReturn(testUuid);
        List<LinkLayer> listLayers = new ArrayList<LinkLayer>();
        listLayers.add(lLayer);
        when(m_CustomCommsService.getLinkLayers()).thenReturn(listLayers);
        m_SUT.handleMessage(message, payload, channel);
        verify(lLayer).delete();
        Message testMessage = null;
        verify(m_MessageFactory).createLinkLayerResponseMessage(eq(message), 
                eq(LinkLayerMessageType.DeleteResponse), eq(testMessage));
        verify(m_ResponseWrapper).queue(channel);
    }
@ Test public void testRemoveLinkLayer ( ) throws IOException , FactoryException { DeleteRequestData request = DeleteRequestData . newBuilder ( ) . setLinkLayerUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( testUuid ) ) . build ( ) ; LinkLayerNamespace ccommMessage = LinkLayerNamespace . newBuilder ( ) . setType ( LinkLayerMessageType . DeleteRequest ) . setData ( request . toByteString ( ) ) . build ( ) ; TerraHarvestPayload payload = createPayload ( ccommMessage ) ; TerraHarvestMessage message = createLinkLayerMessage ( ccommMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; LinkLayer lLayer = mock ( LinkLayer . class ) ; when ( lLayer . getUuid ( ) ) . thenReturn ( testUuid ) ; List < LinkLayer > listLayers = new ArrayList < LinkLayer > ( ) ; listLayers . add ( lLayer ) ; when ( m_CustomCommsService . getLinkLayers ( ) ) . thenReturn ( listLayers ) ; m_SUT . handleMessage ( message , payload , channel ) ; verify ( lLayer ) . delete ( ) ; Message testMessage = null ; verify ( m_MessageFactory ) . createLinkLayerResponseMessage ( eq ( message ) , eq ( LinkLayerMessageType . DeleteResponse ) , eq ( testMessage ) ) ; verify ( m_ResponseWrapper ) . queue ( channel ) ; }
Verify that the core service is requested to remove a link layer, 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 link layer 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 // mock link layer list // verify remove link layer was called