mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testTrySendObservationStoreMessage() throws IOException
    {
        // construct data message to send
        java.util.UUID uuid =java.util.UUID.randomUUID();
        FindObservationByUUIDRequestData messageData = FindObservationByUUIDRequestData.newBuilder().
            addUuidOfObservation(SharedMessageUtils.convertUUIDToProtoUUID(uuid)).build();
        
        MessageWrapper request = m_SUT.createObservationStoreMessage(
                ObservationStoreMessageType.FindObservationByUUIDRequest, messageData);
        
        // request sending, and confirm namespace
        ByteString namespace = confirmWrapperTrySend(request, Namespace.ObservationStore, 1);

        // verify namespace message
        ObservationStoreNamespace obsMessageResponse = ObservationStoreNamespace.parseFrom(namespace);
        assertThat(obsMessageResponse.getType(), is(ObservationStoreMessageType.FindObservationByUUIDRequest));

        //verify data message
        assertThat(obsMessageResponse.getData(), is(messageData.toByteString()));
        
        //--send again with null for the data message--//
        request = m_SUT.createObservationStoreMessage(ObservationStoreMessageType.FindObservationByUUIDRequest, null);
        
        // request sending and verify namespace
        namespace = confirmWrapperTrySend(request, Namespace.ObservationStore, 2);

        // verify namespace message
        obsMessageResponse = ObservationStoreNamespace.parseFrom(namespace);
        assertThat(obsMessageResponse.getType(), is(ObservationStoreMessageType.FindObservationByUUIDRequest));
        
        //verify data message
        assertThat(obsMessageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected observation store contents.
     */
Verify the message wrapper returned contains the expected observation store contents.
Verify the message wrapper returned contains the expected observation store contents .
@Test
    public void testTrySendObservationStoreMessage() throws IOException
    {
        java.util.UUID uuid =java.util.UUID.randomUUID();
        FindObservationByUUIDRequestData messageData = FindObservationByUUIDRequestData.newBuilder().
            addUuidOfObservation(SharedMessageUtils.convertUUIDToProtoUUID(uuid)).build();
        MessageWrapper request = m_SUT.createObservationStoreMessage(
                ObservationStoreMessageType.FindObservationByUUIDRequest, messageData);
        ByteString namespace = confirmWrapperTrySend(request, Namespace.ObservationStore, 1);
        ObservationStoreNamespace obsMessageResponse = ObservationStoreNamespace.parseFrom(namespace);
        assertThat(obsMessageResponse.getType(), is(ObservationStoreMessageType.FindObservationByUUIDRequest));
        assertThat(obsMessageResponse.getData(), is(messageData.toByteString()));
        request = m_SUT.createObservationStoreMessage(ObservationStoreMessageType.FindObservationByUUIDRequest, null);
        namespace = confirmWrapperTrySend(request, Namespace.ObservationStore, 2);
        obsMessageResponse = ObservationStoreNamespace.parseFrom(namespace);
        assertThat(obsMessageResponse.getType(), is(ObservationStoreMessageType.FindObservationByUUIDRequest));
        assertThat(obsMessageResponse.hasData(), is(false));
    }
@ Test public void testTrySendObservationStoreMessage ( ) throws IOException { java . util . UUID uuid = java . util . UUID . randomUUID ( ) ; FindObservationByUUIDRequestData messageData = FindObservationByUUIDRequestData . newBuilder ( ) . addUuidOfObservation ( SharedMessageUtils . convertUUIDToProtoUUID ( uuid ) ) . build ( ) ; MessageWrapper request = m_SUT . createObservationStoreMessage ( ObservationStoreMessageType . FindObservationByUUIDRequest , messageData ) ; ByteString namespace = confirmWrapperTrySend ( request , Namespace . ObservationStore , 1 ) ; ObservationStoreNamespace obsMessageResponse = ObservationStoreNamespace . parseFrom ( namespace ) ; assertThat ( obsMessageResponse . getType ( ) , is ( ObservationStoreMessageType . FindObservationByUUIDRequest ) ) ; assertThat ( obsMessageResponse . getData ( ) , is ( messageData . toByteString ( ) ) ) ; request = m_SUT . createObservationStoreMessage ( ObservationStoreMessageType . FindObservationByUUIDRequest , null ) ; namespace = confirmWrapperTrySend ( request , Namespace . ObservationStore , 2 ) ; obsMessageResponse = ObservationStoreNamespace . parseFrom ( namespace ) ; assertThat ( obsMessageResponse . getType ( ) , is ( ObservationStoreMessageType . FindObservationByUUIDRequest ) ) ; assertThat ( obsMessageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected observation store contents.
Verify the message wrapper returned contains the expected observation store contents .
// construct data message to send // request sending, and confirm namespace // verify namespace message //verify data message //--send again with null for the data message--// // request sending and verify namespace // verify namespace message //verify data message