mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/ccomms/TestTransportLayerMessageService.java
@Test
    public void testShutdown() throws IOException, CCommException
    {
        ShutdownRequestData request = ShutdownRequestData.newBuilder()
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        
        TransportLayerNamespace transportMessage = TransportLayerNamespace.newBuilder()
                .setType(TransportLayerMessageType.ShutdownRequest)
                .setData(request.toByteString())
                .build();
        
        TerraHarvestMessage message = createTransportLayerMessage(transportMessage);
        TerraHarvestPayload payload = createPayload(transportMessage);
        
        // 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((ShutdownRequestData)event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(request));
        
        // make sure shutdown was called on the test transport layer
        verify(testLayer).shutdown();
        
        Message testMessage = null;
        
        verify(m_MessageFactory).createTransportLayerResponseMessage(eq(message), 
                eq(TransportLayerMessageType.ShutdownResponse), eq(testMessage));
        verify(m_ResponseWrapper).queue(channel);
    }
/**
     * Verify shutdown is called on the test transport 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 shutdown is called on the test transport 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 shutdown is called on the test transport 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 testShutdown() throws IOException, CCommException
    {
        ShutdownRequestData request = ShutdownRequestData.newBuilder()
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        TransportLayerNamespace transportMessage = TransportLayerNamespace.newBuilder()
                .setType(TransportLayerMessageType.ShutdownRequest)
                .setData(request.toByteString())
                .build();
        TerraHarvestMessage message = createTransportLayerMessage(transportMessage);
        TerraHarvestPayload payload = createPayload(transportMessage);
        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((ShutdownRequestData)event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(request));
        verify(testLayer).shutdown();
        Message testMessage = null;
        verify(m_MessageFactory).createTransportLayerResponseMessage(eq(message), 
                eq(TransportLayerMessageType.ShutdownResponse), eq(testMessage));
        verify(m_ResponseWrapper).queue(channel);
    }
@ Test public void testShutdown ( ) throws IOException , CCommException { ShutdownRequestData request = ShutdownRequestData . newBuilder ( ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( testUuid ) ) . build ( ) ; TransportLayerNamespace transportMessage = TransportLayerNamespace . newBuilder ( ) . setType ( TransportLayerMessageType . ShutdownRequest ) . setData ( request . toByteString ( ) ) . build ( ) ; TerraHarvestMessage message = createTransportLayerMessage ( transportMessage ) ; TerraHarvestPayload payload = createPayload ( transportMessage ) ; 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 ( ( ShutdownRequestData ) event . getProperty ( RemoteConstants . EVENT_PROP_DATA_MESSAGE ) , is ( request ) ) ; verify ( testLayer ) . shutdown ( ) ; Message testMessage = null ; verify ( m_MessageFactory ) . createTransportLayerResponseMessage ( eq ( message ) , eq ( TransportLayerMessageType . ShutdownResponse ) , eq ( testMessage ) ) ; verify ( m_ResponseWrapper ) . queue ( channel ) ; }
Verify shutdown is called on the test transport 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 shutdown is called on the test transport 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 // verify the event contains the data message // make sure shutdown was called on the test transport layer