mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testQueueBaseMessageResponse() throws IOException
    {
        // construct fake request message
        TerraHarvestMessage request = createRequestFiller();
        
        // construct data message to send
        ControllerInfoData systemInfoData = ControllerInfoData.newBuilder().setName("blah").build();
        
        MessageResponseWrapper response = m_SUT.createBaseMessageResponse(request, BaseMessageType.ControllerInfo, 
                systemInfoData);

        //request to send over mock channel
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.Base);
        
        //namespace
        BaseNamespace baseResponseMessage = BaseNamespace.parseFrom(namespace);
        assertThat(baseResponseMessage.getType(), is(BaseMessageType.ControllerInfo));
        
        //specific message
        assertThat(baseResponseMessage.getData(), is(systemInfoData.toByteString()));
        
        //--send again with no data message--//
        response = m_SUT.createBaseMessageResponse(request, BaseMessageType.ControllerInfo, null);

        //request to send over mock channel
        namespace = confirmResponseWrapperQueue(response, Namespace.Base);
        
        //namespace
        baseResponseMessage = BaseNamespace.parseFrom(namespace);
        assertThat(baseResponseMessage.getType(), is(BaseMessageType.ControllerInfo));
        
        //specific message
        assertThat(baseResponseMessage.hasData(), is(false));
    }
/**
     *  Verify the message response wrapper returned contains the expected base message contents.
     */
Verify the message response wrapper returned contains the expected base message contents.
Verify the message response wrapper returned contains the expected base message contents .
@Test
    public void testQueueBaseMessageResponse() throws IOException
    {
        TerraHarvestMessage request = createRequestFiller();
        ControllerInfoData systemInfoData = ControllerInfoData.newBuilder().setName("blah").build();
        MessageResponseWrapper response = m_SUT.createBaseMessageResponse(request, BaseMessageType.ControllerInfo, 
                systemInfoData);
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.Base);
        BaseNamespace baseResponseMessage = BaseNamespace.parseFrom(namespace);
        assertThat(baseResponseMessage.getType(), is(BaseMessageType.ControllerInfo));
        assertThat(baseResponseMessage.getData(), is(systemInfoData.toByteString()));
        response = m_SUT.createBaseMessageResponse(request, BaseMessageType.ControllerInfo, null);
        namespace = confirmResponseWrapperQueue(response, Namespace.Base);
        baseResponseMessage = BaseNamespace.parseFrom(namespace);
        assertThat(baseResponseMessage.getType(), is(BaseMessageType.ControllerInfo));
        assertThat(baseResponseMessage.hasData(), is(false));
    }
@ Test public void testQueueBaseMessageResponse ( ) throws IOException { TerraHarvestMessage request = createRequestFiller ( ) ; ControllerInfoData systemInfoData = ControllerInfoData . newBuilder ( ) . setName ( "blah" ) . build ( ) ; MessageResponseWrapper response = m_SUT . createBaseMessageResponse ( request , BaseMessageType . ControllerInfo , systemInfoData ) ; ByteString namespace = confirmResponseWrapperQueue ( response , Namespace . Base ) ; BaseNamespace baseResponseMessage = BaseNamespace . parseFrom ( namespace ) ; assertThat ( baseResponseMessage . getType ( ) , is ( BaseMessageType . ControllerInfo ) ) ; assertThat ( baseResponseMessage . getData ( ) , is ( systemInfoData . toByteString ( ) ) ) ; response = m_SUT . createBaseMessageResponse ( request , BaseMessageType . ControllerInfo , null ) ; namespace = confirmResponseWrapperQueue ( response , Namespace . Base ) ; baseResponseMessage = BaseNamespace . parseFrom ( namespace ) ; assertThat ( baseResponseMessage . getType ( ) , is ( BaseMessageType . ControllerInfo ) ) ; assertThat ( baseResponseMessage . hasData ( ) , is ( false ) ) ; }
Verify the message response wrapper returned contains the expected base message contents.
Verify the message response wrapper returned contains the expected base message contents .
// construct fake request message // construct data message to send //request to send over mock channel //namespace //specific message //--send again with no data message--// //request to send over mock channel //namespace //specific message