mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testQueueAssetResponse() throws IOException
    {
        // construct fake request message
        TerraHarvestMessage request = createRequestFiller();
        
        // construct data message to send
        UUID uuid = UUID.newBuilder().setLeastSignificantBits(1L).setMostSignificantBits(2L).build();
        CaptureDataRequestData messageData = 
                CaptureDataRequestData.newBuilder().setUuid(uuid).build();
        
        MessageResponseWrapper response = 
                m_SUT.createAssetResponseMessage(request, AssetMessageType.CaptureDataResponse, messageData);

        // request to send over mock channel
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.Asset);
       
        // verify namespace message
        AssetNamespace messageResponse = AssetNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(AssetMessageType.CaptureDataResponse));

        //verify data message
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        
        //--send again with no data message--//
        response = m_SUT.createAssetResponseMessage(request, AssetMessageType.CaptureDataResponse, null);

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

        // verify namespace message
        messageResponse = AssetNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(AssetMessageType.CaptureDataResponse));
        
        //verify data message
        assertThat(messageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected asset namespace contents.
     */
Verify the message wrapper returned contains the expected asset namespace contents.
Verify the message wrapper returned contains the expected asset namespace contents .
@Test
    public void testQueueAssetResponse() throws IOException
    {
        TerraHarvestMessage request = createRequestFiller();
        UUID uuid = UUID.newBuilder().setLeastSignificantBits(1L).setMostSignificantBits(2L).build();
        CaptureDataRequestData messageData = 
                CaptureDataRequestData.newBuilder().setUuid(uuid).build();
        MessageResponseWrapper response = 
                m_SUT.createAssetResponseMessage(request, AssetMessageType.CaptureDataResponse, messageData);
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.Asset);
        AssetNamespace messageResponse = AssetNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(AssetMessageType.CaptureDataResponse));
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        response = m_SUT.createAssetResponseMessage(request, AssetMessageType.CaptureDataResponse, null);
        namespace = confirmResponseWrapperQueue(response, Namespace.Asset);
        messageResponse = AssetNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(AssetMessageType.CaptureDataResponse));
        assertThat(messageResponse.hasData(), is(false));
    }
@ Test public void testQueueAssetResponse ( ) throws IOException { TerraHarvestMessage request = createRequestFiller ( ) ; UUID uuid = UUID . newBuilder ( ) . setLeastSignificantBits ( 1L ) . setMostSignificantBits ( 2L ) . build ( ) ; CaptureDataRequestData messageData = CaptureDataRequestData . newBuilder ( ) . setUuid ( uuid ) . build ( ) ; MessageResponseWrapper response = m_SUT . createAssetResponseMessage ( request , AssetMessageType . CaptureDataResponse , messageData ) ; ByteString namespace = confirmResponseWrapperQueue ( response , Namespace . Asset ) ; AssetNamespace messageResponse = AssetNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( AssetMessageType . CaptureDataResponse ) ) ; assertThat ( messageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; response = m_SUT . createAssetResponseMessage ( request , AssetMessageType . CaptureDataResponse , null ) ; namespace = confirmResponseWrapperQueue ( response , Namespace . Asset ) ; messageResponse = AssetNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( AssetMessageType . CaptureDataResponse ) ) ; assertThat ( messageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected asset namespace contents.
Verify the message wrapper returned contains the expected asset namespace contents .
// construct fake request message // construct data message to send // request to send over mock channel // verify namespace message //verify data message //--send again with no data message--// // request to send over mock channel // verify namespace message //verify data message