mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/observation/TestObservationMessageService.java
@Test

    public void testRemoveObservationByUUID() throws IOException
    {
        //removal message
        RemoveObservationByUUIDRequestData request = RemoveObservationByUUIDRequestData.newBuilder().
            addUuidOfObservation(SharedMessageUtils.convertUUIDToProtoUUID(uuidObs1)).
            addUuidOfObservation(SharedMessageUtils.convertUUIDToProtoUUID(uuidObs2)).build();
        ObservationStoreNamespace obsMessage = ObservationStoreNamespace.newBuilder().
            setData(request.toByteString()).
            setType(ObservationStoreMessageType.RemoveObservationByUUIDRequest).build();
        TerraHarvestPayload payload = createPayload(obsMessage);
        TerraHarvestMessage thMessage = createMessageObservationStore(obsMessage);

        // mock the channel the message came from
        RemoteChannel channel = mock(RemoteChannel.class);

        // replay
        m_SUT.handleMessage(thMessage, payload, channel);

        verify(m_MessageFactory).createObservationStoreResponseMessage(eq(thMessage), 
            eq(ObservationStoreMessageType.RemoveObservationByUUIDResponse), (Message) eq(null));
        verify(m_ResponseWrapper).queue(channel);

        //verify obs store calls
        verify(m_ObservationStore).remove(uuidObs1);
        verify(m_ObservationStore).remove(uuidObs2);
    }
/**
     * Test remove observation by UUID.
     */
Test remove observation by UUID.
Test remove observation by UUID .
@Test
    public void testRemoveObservationByUUID() throws IOException
    {
        RemoveObservationByUUIDRequestData request = RemoveObservationByUUIDRequestData.newBuilder().
            addUuidOfObservation(SharedMessageUtils.convertUUIDToProtoUUID(uuidObs1)).
            addUuidOfObservation(SharedMessageUtils.convertUUIDToProtoUUID(uuidObs2)).build();
        ObservationStoreNamespace obsMessage = ObservationStoreNamespace.newBuilder().
            setData(request.toByteString()).
            setType(ObservationStoreMessageType.RemoveObservationByUUIDRequest).build();
        TerraHarvestPayload payload = createPayload(obsMessage);
        TerraHarvestMessage thMessage = createMessageObservationStore(obsMessage);
        RemoteChannel channel = mock(RemoteChannel.class);
        m_SUT.handleMessage(thMessage, payload, channel);
        verify(m_MessageFactory).createObservationStoreResponseMessage(eq(thMessage), 
            eq(ObservationStoreMessageType.RemoveObservationByUUIDResponse), (Message) eq(null));
        verify(m_ResponseWrapper).queue(channel);
        verify(m_ObservationStore).remove(uuidObs1);
        verify(m_ObservationStore).remove(uuidObs2);
    }
@ Test public void testRemoveObservationByUUID ( ) throws IOException { RemoveObservationByUUIDRequestData request = RemoveObservationByUUIDRequestData . newBuilder ( ) . addUuidOfObservation ( SharedMessageUtils . convertUUIDToProtoUUID ( uuidObs1 ) ) . addUuidOfObservation ( SharedMessageUtils . convertUUIDToProtoUUID ( uuidObs2 ) ) . build ( ) ; ObservationStoreNamespace obsMessage = ObservationStoreNamespace . newBuilder ( ) . setData ( request . toByteString ( ) ) . setType ( ObservationStoreMessageType . RemoveObservationByUUIDRequest ) . build ( ) ; TerraHarvestPayload payload = createPayload ( obsMessage ) ; TerraHarvestMessage thMessage = createMessageObservationStore ( obsMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; m_SUT . handleMessage ( thMessage , payload , channel ) ; verify ( m_MessageFactory ) . createObservationStoreResponseMessage ( eq ( thMessage ) , eq ( ObservationStoreMessageType . RemoveObservationByUUIDResponse ) , ( Message ) eq ( null ) ) ; verify ( m_ResponseWrapper ) . queue ( channel ) ; verify ( m_ObservationStore ) . remove ( uuidObs1 ) ; verify ( m_ObservationStore ) . remove ( uuidObs2 ) ; }
Test remove observation by UUID.
Test remove observation by UUID .
//removal message // mock the channel the message came from // replay //verify obs store calls