mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testQueueConfigAdminResponse() throws IOException
    {
        // construct fake request message
        TerraHarvestMessage request = createRequestFiller();
        
        // construct data message to send
        GetConfigurationInfoRequestData messageData = 
                GetConfigurationInfoRequestData.newBuilder().setFilter("test").setIncludeProperties(false).build();
        
        MessageResponseWrapper response = 
                m_SUT.createConfigAdminResponseMessage(request, ConfigAdminMessageType.GetConfigurationInfoRequest, 
                        messageData);

        // request to send over mock channel and verify namespace
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.ConfigAdmin);
        
        // verify namespace message
        ConfigAdminNamespace messageResponse = ConfigAdminNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(ConfigAdminMessageType.GetConfigurationInfoRequest));
        
        //verify data message
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        
        //--send again with no data message--//
        response = m_SUT.createConfigAdminResponseMessage(request, ConfigAdminMessageType.GetConfigurationInfoRequest, 
                        null);

        // request to send over mock channel and verify namespace
        namespace = confirmResponseWrapperQueue(response, Namespace.ConfigAdmin);
      
        // verify namespace message
        messageResponse = ConfigAdminNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(ConfigAdminMessageType.GetConfigurationInfoRequest));
        
        //verify data message
        assertThat(messageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected config admin contents.
     */
Verify the message wrapper returned contains the expected config admin contents.
Verify the message wrapper returned contains the expected config admin contents .
@Test
    public void testQueueConfigAdminResponse() throws IOException
    {
        TerraHarvestMessage request = createRequestFiller();
        GetConfigurationInfoRequestData messageData = 
                GetConfigurationInfoRequestData.newBuilder().setFilter("test").setIncludeProperties(false).build();
        MessageResponseWrapper response = 
                m_SUT.createConfigAdminResponseMessage(request, ConfigAdminMessageType.GetConfigurationInfoRequest, 
                        messageData);
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.ConfigAdmin);
        ConfigAdminNamespace messageResponse = ConfigAdminNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(ConfigAdminMessageType.GetConfigurationInfoRequest));
        assertThat(messageResponse.getData(), is(messageData.toByteString()));
        response = m_SUT.createConfigAdminResponseMessage(request, ConfigAdminMessageType.GetConfigurationInfoRequest, 
                        null);
        namespace = confirmResponseWrapperQueue(response, Namespace.ConfigAdmin);
        messageResponse = ConfigAdminNamespace.parseFrom(namespace);
        assertThat(messageResponse.getType(), is(ConfigAdminMessageType.GetConfigurationInfoRequest));
        assertThat(messageResponse.hasData(), is(false));
    }
@ Test public void testQueueConfigAdminResponse ( ) throws IOException { TerraHarvestMessage request = createRequestFiller ( ) ; GetConfigurationInfoRequestData messageData = GetConfigurationInfoRequestData . newBuilder ( ) . setFilter ( "test" ) . setIncludeProperties ( false ) . build ( ) ; MessageResponseWrapper response = m_SUT . createConfigAdminResponseMessage ( request , ConfigAdminMessageType . GetConfigurationInfoRequest , messageData ) ; ByteString namespace = confirmResponseWrapperQueue ( response , Namespace . ConfigAdmin ) ; ConfigAdminNamespace messageResponse = ConfigAdminNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( ConfigAdminMessageType . GetConfigurationInfoRequest ) ) ; assertThat ( messageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; response = m_SUT . createConfigAdminResponseMessage ( request , ConfigAdminMessageType . GetConfigurationInfoRequest , null ) ; namespace = confirmResponseWrapperQueue ( response , Namespace . ConfigAdmin ) ; messageResponse = ConfigAdminNamespace . parseFrom ( namespace ) ; assertThat ( messageResponse . getType ( ) , is ( ConfigAdminMessageType . GetConfigurationInfoRequest ) ) ; assertThat ( messageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected config admin contents.
Verify the message wrapper returned contains the expected config admin 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