mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testQueueMissionResponse() throws IOException
    {
        // construct fake request message
        TerraHarvestMessage request = createRequestFiller();
                
        // construct data message to send
        MissionProgramTemplate template = MissionProgramTemplate.newBuilder().setName("test").setSource("src").build();
        GetTemplatesResponseData getTemplateData = GetTemplatesResponseData.newBuilder().addTemplate(template).build();
        
        MessageResponseWrapper response = 
            m_SUT.createMissionProgrammingResponseMessage(request, MissionProgrammingMessageType.GetTemplatesResponse, 
                    getTemplateData);

        //request to send over mock channel
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.MissionProgramming);
        
        // verify namespace message
        MissionProgrammingNamespace messageResponse = MissionProgrammingNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(MissionProgrammingMessageType.GetTemplatesResponse));

        //verify data message
        assertThat(messageResponse.getData(), is(getTemplateData.toByteString()));
        
        //--send again with no data message--//
        response = m_SUT.createMissionProgrammingResponseMessage(request,
                MissionProgrammingMessageType.GetTemplatesResponse, null);

        // request to send over mock channel and verify namespace
        namespace = confirmResponseWrapperQueue(response, Namespace.MissionProgramming);
        
        // verify namespace message
        messageResponse = MissionProgrammingNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(MissionProgrammingMessageType.GetTemplatesResponse));

        // verify data message
        assertThat(messageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected mission programming contents.
     */
Verify the message wrapper returned contains the expected mission programming contents.
Verify the message wrapper returned contains the expected mission programming contents .
@Test
    public void testQueueMissionResponse() throws IOException
    {
        TerraHarvestMessage request = createRequestFiller();
        MissionProgramTemplate template = MissionProgramTemplate.newBuilder().setName("test").setSource("src").build();
        GetTemplatesResponseData getTemplateData = GetTemplatesResponseData.newBuilder().addTemplate(template).build();
        MessageResponseWrapper response = 
            m_SUT.createMissionProgrammingResponseMessage(request, MissionProgrammingMessageType.GetTemplatesResponse, 
                    getTemplateData);
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.MissionProgramming);
        MissionProgrammingNamespace messageResponse = MissionProgrammingNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(MissionProgrammingMessageType.GetTemplatesResponse));
        assertThat(messageResponse.getData(), is(getTemplateData.toByteString()));
        response = m_SUT.createMissionProgrammingResponseMessage(request,
                MissionProgrammingMessageType.GetTemplatesResponse, null);
        namespace = confirmResponseWrapperQueue(response, Namespace.MissionProgramming);
        messageResponse = MissionProgrammingNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(MissionProgrammingMessageType.GetTemplatesResponse));
        assertThat(messageResponse.hasData(), is(false));
    }
@ Test public void testQueueMissionResponse ( ) throws IOException { TerraHarvestMessage request = createRequestFiller ( ) ; MissionProgramTemplate template = MissionProgramTemplate . newBuilder ( ) . setName ( "test" ) . setSource ( "src" ) . build ( ) ; GetTemplatesResponseData getTemplateData = GetTemplatesResponseData . newBuilder ( ) . addTemplate ( template ) . build ( ) ; MessageResponseWrapper response = m_SUT . createMissionProgrammingResponseMessage ( request , MissionProgrammingMessageType . GetTemplatesResponse , getTemplateData ) ; ByteString namespace = confirmResponseWrapperQueue ( response , Namespace . MissionProgramming ) ; MissionProgrammingNamespace messageResponse = MissionProgrammingNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( MissionProgrammingMessageType . GetTemplatesResponse ) ) ; assertThat ( messageResponse . getData ( ) , is ( getTemplateData . toByteString ( ) ) ) ; response = m_SUT . createMissionProgrammingResponseMessage ( request , MissionProgrammingMessageType . GetTemplatesResponse , null ) ; namespace = confirmResponseWrapperQueue ( response , Namespace . MissionProgramming ) ; messageResponse = MissionProgrammingNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( MissionProgrammingMessageType . GetTemplatesResponse ) ) ; assertThat ( messageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected mission programming contents.
Verify the message wrapper returned contains the expected mission programming 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 and verify namespace // verify namespace message // verify data message