mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testQueueAssetDirectoryServiceResponse() throws IOException
    {
        // construct fake request message
        TerraHarvestMessage request = createRequestFiller();
        
        // construct data message to send
        GetCapabilitiesResponseData messageData = GetCapabilitiesResponseData.newBuilder().setProductType("a")
                .setCapabilities(AssetCapabilities.newBuilder()
                        .setBase(BaseCapabilitiesGen.BaseCapabilities.newBuilder()
                            .setProductName("name")
                            .setDescription("desc"))
                        .build())
                .build();
        
        MessageResponseWrapper response = m_SUT.createAssetDirectoryServiceResponseMessage(request, 
                AssetDirectoryServiceMessageType.GetCapabilitiesResponse, messageData);

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

        // verify namespace message
        AssetDirectoryServiceNamespace messageResponse = AssetDirectoryServiceNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(AssetDirectoryServiceMessageType.GetCapabilitiesResponse));

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

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

        // verify namespace message
        messageResponse = AssetDirectoryServiceNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(AssetDirectoryServiceMessageType.GetCapabilitiesResponse));
        
        //verify data message
        assertThat(messageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected asset directory service contents.
     */
Verify the message wrapper returned contains the expected asset directory service contents.
Verify the message wrapper returned contains the expected asset directory service contents .
@Test
    public void testQueueAssetDirectoryServiceResponse() throws IOException
    {
        TerraHarvestMessage request = createRequestFiller();
        GetCapabilitiesResponseData messageData = GetCapabilitiesResponseData.newBuilder().setProductType("a")
                .setCapabilities(AssetCapabilities.newBuilder()
                        .setBase(BaseCapabilitiesGen.BaseCapabilities.newBuilder()
                            .setProductName("name")
                            .setDescription("desc"))
                        .build())
                .build();
        MessageResponseWrapper response = m_SUT.createAssetDirectoryServiceResponseMessage(request, 
                AssetDirectoryServiceMessageType.GetCapabilitiesResponse, messageData);
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.AssetDirectoryService);
        AssetDirectoryServiceNamespace messageResponse = AssetDirectoryServiceNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(AssetDirectoryServiceMessageType.GetCapabilitiesResponse));
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        response = m_SUT.createAssetDirectoryServiceResponseMessage(request, 
                AssetDirectoryServiceMessageType.GetCapabilitiesResponse, null);
        namespace = confirmResponseWrapperQueue(response, Namespace.AssetDirectoryService);
        messageResponse = AssetDirectoryServiceNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(AssetDirectoryServiceMessageType.GetCapabilitiesResponse));
        assertThat(messageResponse.hasData(), is(false));
    }
@ Test public void testQueueAssetDirectoryServiceResponse ( ) throws IOException { TerraHarvestMessage request = createRequestFiller ( ) ; GetCapabilitiesResponseData messageData = GetCapabilitiesResponseData . newBuilder ( ) . setProductType ( "a" ) . setCapabilities ( AssetCapabilities . newBuilder ( ) . setBase ( BaseCapabilitiesGen . BaseCapabilities . newBuilder ( ) . setProductName ( "name" ) . setDescription ( "desc" ) ) . build ( ) ) . build ( ) ; MessageResponseWrapper response = m_SUT . createAssetDirectoryServiceResponseMessage ( request , AssetDirectoryServiceMessageType . GetCapabilitiesResponse , messageData ) ; ByteString namespace = confirmResponseWrapperQueue ( response , Namespace . AssetDirectoryService ) ; AssetDirectoryServiceNamespace messageResponse = AssetDirectoryServiceNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( AssetDirectoryServiceMessageType . GetCapabilitiesResponse ) ) ; assertThat ( messageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; response = m_SUT . createAssetDirectoryServiceResponseMessage ( request , AssetDirectoryServiceMessageType . GetCapabilitiesResponse , null ) ; namespace = confirmResponseWrapperQueue ( response , Namespace . AssetDirectoryService ) ; messageResponse = AssetDirectoryServiceNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( AssetDirectoryServiceMessageType . GetCapabilitiesResponse ) ) ; assertThat ( messageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected asset directory service contents.
Verify the message wrapper returned contains the expected asset directory service 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 // verify namespace message //verify data message