mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testQueueTransportLayerMessageResponse() throws InvalidProtocolBufferException
    {
        // construct fake request message
        TerraHarvestMessage request = createRequestFiller();
        
        java.util.UUID testUuid = java.util.UUID.randomUUID();
        
        // construct data message to send
        IsReceivingRequestData messageData = IsReceivingRequestData.newBuilder()
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        
        MessageResponseWrapper response = m_SUT.createTransportLayerResponseMessage(request, 
                TransportLayerMessageType.IsReceivingResponse, messageData);

        // request to send over mock channel and verify namespace
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.TransportLayer);

        // verify namespace message
        TransportLayerNamespace transportResponse = TransportLayerNamespace.parseFrom(namespace);
        assertThat(transportResponse.getType(), is(TransportLayerMessageType.IsReceivingResponse));

        //verify data message
        assertThat(transportResponse.getData(), is(messageData.toByteString()));
        
        //--send again with no data message--//
        response = m_SUT.createTransportLayerResponseMessage(request,TransportLayerMessageType.IsReceivingResponse, 
                null);

        // request to send over mock channel and verify namespace
        namespace = confirmResponseWrapperQueue(response, Namespace.TransportLayer);

        // verify namespace message
        transportResponse = TransportLayerNamespace.parseFrom(namespace);
        assertThat(transportResponse.getType(), is(TransportLayerMessageType.IsReceivingResponse));
        
        //verify data message
        assertThat(transportResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected transport layer contents.
     */
Verify the message wrapper returned contains the expected transport layer contents.
Verify the message wrapper returned contains the expected transport layer contents .
@Test
    public void testQueueTransportLayerMessageResponse() throws InvalidProtocolBufferException
    {
        TerraHarvestMessage request = createRequestFiller();
        java.util.UUID testUuid = java.util.UUID.randomUUID();
        IsReceivingRequestData messageData = IsReceivingRequestData.newBuilder()
                .setUuid(SharedMessageUtils.convertUUIDToProtoUUID(testUuid))
                .build();
        MessageResponseWrapper response = m_SUT.createTransportLayerResponseMessage(request, 
                TransportLayerMessageType.IsReceivingResponse, messageData);
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.TransportLayer);
        TransportLayerNamespace transportResponse = TransportLayerNamespace.parseFrom(namespace);
        assertThat(transportResponse.getType(), is(TransportLayerMessageType.IsReceivingResponse));
        assertThat(transportResponse.getData(), is(messageData.toByteString()));
        response = m_SUT.createTransportLayerResponseMessage(request,TransportLayerMessageType.IsReceivingResponse, 
                null);
        namespace = confirmResponseWrapperQueue(response, Namespace.TransportLayer);
        transportResponse = TransportLayerNamespace.parseFrom(namespace);
        assertThat(transportResponse.getType(), is(TransportLayerMessageType.IsReceivingResponse));
        assertThat(transportResponse.hasData(), is(false));
    }
@ Test public void testQueueTransportLayerMessageResponse ( ) throws InvalidProtocolBufferException { TerraHarvestMessage request = createRequestFiller ( ) ; java . util . UUID testUuid = java . util . UUID . randomUUID ( ) ; IsReceivingRequestData messageData = IsReceivingRequestData . newBuilder ( ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( testUuid ) ) . build ( ) ; MessageResponseWrapper response = m_SUT . createTransportLayerResponseMessage ( request , TransportLayerMessageType . IsReceivingResponse , messageData ) ; ByteString namespace = confirmResponseWrapperQueue ( response , Namespace . TransportLayer ) ; TransportLayerNamespace transportResponse = TransportLayerNamespace . parseFrom ( namespace ) ; assertThat ( transportResponse . getType ( ) , is ( TransportLayerMessageType . IsReceivingResponse ) ) ; assertThat ( transportResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; response = m_SUT . createTransportLayerResponseMessage ( request , TransportLayerMessageType . IsReceivingResponse , null ) ; namespace = confirmResponseWrapperQueue ( response , Namespace . TransportLayer ) ; transportResponse = TransportLayerNamespace . parseFrom ( namespace ) ; assertThat ( transportResponse . getType ( ) , is ( TransportLayerMessageType . IsReceivingResponse ) ) ; assertThat ( transportResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected transport layer contents.
Verify the message wrapper returned contains the expected transport layer contents .
// construct fake request message // construct data message to send // request to send over mock channel and verify namespace // verify namespace message //verify data message //--send again with no data message--// // request to send over mock channel and verify namespace // verify namespace message //verify data message