mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/ccomms/TestLinkLayerMessageService.java
@Test
    public void testActivate() throws IOException
    {
        // build the terra harvest message
        ActivateRequestData request = ActivateRequestData.newBuilder()
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        
        LinkLayerNamespace llMessage = LinkLayerNamespace.newBuilder()
                .setType(LinkLayerMessageType.ActivateRequest)
                .setData(request.toByteString())
                .build();
        
        TerraHarvestPayload payload = createPayload(llMessage);
        TerraHarvestMessage message = createLinkLayerMessage(llMessage);
        
        // mock the channel the message came from
        RemoteChannel channel = mock(RemoteChannel.class);
        
        m_SUT.handleMessage(message, payload, channel);

        
        // verify the event contains the data message
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event event = eventCaptor.getValue();
        
        assertThat((ActivateRequestData)event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(request));
        
        // make sure activate was called on the test link layer
        verify(testLayer).activateLayer();
        
        Message testMessage = null;
        
        verify(m_MessageFactory).createLinkLayerResponseMessage(eq(message), 
                eq(LinkLayerMessageType.ActivateResponse), eq(testMessage));
        verify(m_ResponseWrapper).queue(channel);
    }
/**
     * Verify link layer was requested to activate, 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 link layer was requested to activate, 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 link layer was requested to activate 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 testActivate() throws IOException
    {
        ActivateRequestData request = ActivateRequestData.newBuilder()
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        LinkLayerNamespace llMessage = LinkLayerNamespace.newBuilder()
                .setType(LinkLayerMessageType.ActivateRequest)
                .setData(request.toByteString())
                .build();
        TerraHarvestPayload payload = createPayload(llMessage);
        TerraHarvestMessage message = createLinkLayerMessage(llMessage);
        RemoteChannel channel = mock(RemoteChannel.class);
        m_SUT.handleMessage(message, payload, channel);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event event = eventCaptor.getValue();
        assertThat((ActivateRequestData)event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(request));
        verify(testLayer).activateLayer();
        Message testMessage = null;
        verify(m_MessageFactory).createLinkLayerResponseMessage(eq(message), 
                eq(LinkLayerMessageType.ActivateResponse), eq(testMessage));
        verify(m_ResponseWrapper).queue(channel);
    }
@ Test public void testActivate ( ) throws IOException { ActivateRequestData request = ActivateRequestData . newBuilder ( ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( testUuid ) ) . build ( ) ; LinkLayerNamespace llMessage = LinkLayerNamespace . newBuilder ( ) . setType ( LinkLayerMessageType . ActivateRequest ) . setData ( request . toByteString ( ) ) . build ( ) ; TerraHarvestPayload payload = createPayload ( llMessage ) ; TerraHarvestMessage message = createLinkLayerMessage ( llMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; m_SUT . handleMessage ( message , payload , channel ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( eventCaptor . capture ( ) ) ; Event event = eventCaptor . getValue ( ) ; assertThat ( ( ActivateRequestData ) event . getProperty ( RemoteConstants . EVENT_PROP_DATA_MESSAGE ) , is ( request ) ) ; verify ( testLayer ) . activateLayer ( ) ; Message testMessage = null ; verify ( m_MessageFactory ) . createLinkLayerResponseMessage ( eq ( message ) , eq ( LinkLayerMessageType . ActivateResponse ) , eq ( testMessage ) ) ; verify ( m_ResponseWrapper ) . queue ( channel ) ; }
Verify link layer was requested to activate, 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 link layer was requested to activate 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 .
// build the terra harvest message // mock the channel the message came from // verify the event contains the data message // make sure activate was called on the test link layer