mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testQueueEventResponse() throws IOException
    {
        // construct fake request message
        TerraHarvestMessage request = createRequestFiller();
        
        // construct data message to send
        SendEventData messageData = SendEventData.newBuilder().setTopic("test").build();
        
        MessageResponseWrapper response = 
                m_SUT.createEventAdminResponseMessage(request, EventAdminMessageType.SendEvent, messageData);

        // request to send over mock channel
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.EventAdmin);
        
        // verify namespace message
        EventAdminNamespace eventAdminMessageResponse = EventAdminNamespace.parseFrom(namespace);
        assertThat(eventAdminMessageResponse.getType(), is(EventAdminMessageType.SendEvent));
        
        //verify data message
        assertThat(eventAdminMessageResponse.getData(), is(messageData.toByteString()));
        
        //--send again with no data message--//
        response = m_SUT.createEventAdminResponseMessage(request, EventAdminMessageType.SendEvent, null);

        // request to send over mock channel and verify namespace
        namespace = confirmResponseWrapperQueue(response, Namespace.EventAdmin);
        
        // verify namespace message
        eventAdminMessageResponse = EventAdminNamespace.parseFrom(namespace);
        assertThat(eventAdminMessageResponse.getType(), is(EventAdminMessageType.SendEvent));
        
        //verify data message
        assertThat(eventAdminMessageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected event admin contents.
     */
Verify the message wrapper returned contains the expected event admin contents.
Verify the message wrapper returned contains the expected event admin contents .
@Test
    public void testQueueEventResponse() throws IOException
    {
        TerraHarvestMessage request = createRequestFiller();
        SendEventData messageData = SendEventData.newBuilder().setTopic("test").build();
        MessageResponseWrapper response = 
                m_SUT.createEventAdminResponseMessage(request, EventAdminMessageType.SendEvent, messageData);
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.EventAdmin);
        EventAdminNamespace eventAdminMessageResponse = EventAdminNamespace.parseFrom(namespace);
        assertThat(eventAdminMessageResponse.getType(), is(EventAdminMessageType.SendEvent));
        assertThat(eventAdminMessageResponse.getData(), is(messageData.toByteString()));
        response = m_SUT.createEventAdminResponseMessage(request, EventAdminMessageType.SendEvent, null);
         and verify namespace
        namespace = confirmResponseWrapperQueue(response, Namespace.EventAdmin);
        eventAdminMessageResponse = EventAdminNamespace.parseFrom(namespace);
        assertThat(eventAdminMessageResponse.getType(), is(EventAdminMessageType.SendEvent));
        assertThat(eventAdminMessageResponse.hasData(), is(false));
    }
@ Test public void testQueueEventResponse ( ) throws IOException { TerraHarvestMessage request = createRequestFiller ( ) ; SendEventData messageData = SendEventData . newBuilder ( ) . setTopic ( "test" ) . build ( ) ; MessageResponseWrapper response = m_SUT . createEventAdminResponseMessage ( request , EventAdminMessageType . SendEvent , messageData ) ; ByteString namespace = confirmResponseWrapperQueue ( response , Namespace . EventAdmin ) ; EventAdminNamespace eventAdminMessageResponse = EventAdminNamespace . parseFrom ( namespace ) ; assertThat ( eventAdminMessageResponse . getType ( ) , is ( EventAdminMessageType . SendEvent ) ) ; assertThat ( eventAdminMessageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; response = m_SUT . createEventAdminResponseMessage ( request , EventAdminMessageType . SendEvent , null ) ; namespace = confirmResponseWrapperQueue ( response , Namespace . EventAdmin ) ; eventAdminMessageResponse = EventAdminNamespace . parseFrom ( namespace ) ; assertThat ( eventAdminMessageResponse . getType ( ) , is ( EventAdminMessageType . SendEvent ) ) ; assertThat ( eventAdminMessageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected event admin contents.
Verify the message wrapper returned contains the expected event admin 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