mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testQueueBundleResponse() throws IOException
    {
        // construct fake request message
        TerraHarvestMessage request = createRequestFiller();
        
        // construct data message to send
        GetBundleInfoRequestData messageData = GetBundleInfoRequestData.newBuilder().setBundleId(1L).build();

        MessageResponseWrapper response = m_SUT.createBundleResponseMessage(request, 
                BundleMessageType.GetBundleInfoResponse, messageData);

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

        // verify namespace message
        BundleNamespace messageResponse = BundleNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(BundleMessageType.GetBundleInfoResponse));

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

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

        // verify namespace message
        messageResponse = BundleNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(BundleMessageType.GetBundleInfoResponse));
        
        //verify data message
        assertThat(messageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected bundle contents.
     */
Verify the message wrapper returned contains the expected bundle contents.
Verify the message wrapper returned contains the expected bundle contents .
@Test
    public void testQueueBundleResponse() throws IOException
    {
        TerraHarvestMessage request = createRequestFiller();
        GetBundleInfoRequestData messageData = GetBundleInfoRequestData.newBuilder().setBundleId(1L).build();
        MessageResponseWrapper response = m_SUT.createBundleResponseMessage(request, 
                BundleMessageType.GetBundleInfoResponse, messageData);
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.Bundle);
        BundleNamespace messageResponse = BundleNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(BundleMessageType.GetBundleInfoResponse));
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        response = m_SUT.createBundleResponseMessage(request, 
                BundleMessageType.GetBundleInfoResponse, null);
        namespace = confirmResponseWrapperQueue(response, Namespace.Bundle);
        messageResponse = BundleNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(BundleMessageType.GetBundleInfoResponse));
        assertThat(messageResponse.hasData(), is(false));
    }
@ Test public void testQueueBundleResponse ( ) throws IOException { TerraHarvestMessage request = createRequestFiller ( ) ; GetBundleInfoRequestData messageData = GetBundleInfoRequestData . newBuilder ( ) . setBundleId ( 1L ) . build ( ) ; MessageResponseWrapper response = m_SUT . createBundleResponseMessage ( request , BundleMessageType . GetBundleInfoResponse , messageData ) ; ByteString namespace = confirmResponseWrapperQueue ( response , Namespace . Bundle ) ; BundleNamespace messageResponse = BundleNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( BundleMessageType . GetBundleInfoResponse ) ) ; assertThat ( messageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; response = m_SUT . createBundleResponseMessage ( request , BundleMessageType . GetBundleInfoResponse , null ) ; namespace = confirmResponseWrapperQueue ( response , Namespace . Bundle ) ; messageResponse = BundleNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( BundleMessageType . GetBundleInfoResponse ) ) ; assertThat ( messageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected bundle contents.
Verify the message wrapper returned contains the expected bundle 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