mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/observation/TestRemoteObservationListener.java
@Test
    public void testGetObservationResponse_InvalidFormat() throws Exception
    {
        GetObservationResponseData response = GetObservationResponseData.newBuilder()
                .setObservationFormat(RemoteTypesGen.LexiconFormat.Enum.XML)
                .addObservationXml(ByteString.copyFromUtf8("blah"))
                .addObservationXml(ByteString.copyFromUtf8("dee"))
                .addObservationXml(ByteString.copyFromUtf8("blah-blah")).build();
        
        m_ObservationHandler.handleEvent(createEvent(response, Namespace.ObservationStore, 
            ObservationStoreMessageType.GetObservationResponse.toString()));

        verify(m_ObservationStore, timeout(1000).never()).persist(Mockito.any(Observation.class));
        
        ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
        //verify push event
        verify(m_EventAdmin).postEvent(captor.capture());
        assertThat(captor.getValue().getTopic(), is(RemoteEventConstants.TOPIC_OBS_STORE_RETRIEVE_COMPLETE));
        assertThat((Integer)captor.getValue().getProperty(RemoteEventConstants.EVENT_PROP_OBS_NUMBER_RETRIEVED), is(0));
    }
/**
     * Test loading get observation response data.
     * Verify that the observation loading interactions take place.
     */
Test loading get observation response data.
Verify that the observation loading interactions take place.
Test loading get observation response data . Verify that the observation loading interactions take place .
@Test
    public void testGetObservationResponse_InvalidFormat() throws Exception
    {
        GetObservationResponseData response = GetObservationResponseData.newBuilder()
                .setObservationFormat(RemoteTypesGen.LexiconFormat.Enum.XML)
                .addObservationXml(ByteString.copyFromUtf8("blah"))
                .addObservationXml(ByteString.copyFromUtf8("dee"))
                .addObservationXml(ByteString.copyFromUtf8("blah-blah")).build();
        m_ObservationHandler.handleEvent(createEvent(response, Namespace.ObservationStore, 
            ObservationStoreMessageType.GetObservationResponse.toString()));
        verify(m_ObservationStore, timeout(1000).never()).persist(Mockito.any(Observation.class));
        ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(captor.capture());
        assertThat(captor.getValue().getTopic(), is(RemoteEventConstants.TOPIC_OBS_STORE_RETRIEVE_COMPLETE));
        assertThat((Integer)captor.getValue().getProperty(RemoteEventConstants.EVENT_PROP_OBS_NUMBER_RETRIEVED), is(0));
    }
@ Test public void testGetObservationResponse_InvalidFormat ( ) throws Exception { GetObservationResponseData response = GetObservationResponseData . newBuilder ( ) . setObservationFormat ( RemoteTypesGen . LexiconFormat . Enum . XML ) . addObservationXml ( ByteString . copyFromUtf8 ( "blah" ) ) . addObservationXml ( ByteString . copyFromUtf8 ( "dee" ) ) . addObservationXml ( ByteString . copyFromUtf8 ( "blah-blah" ) ) . build ( ) ; m_ObservationHandler . handleEvent ( createEvent ( response , Namespace . ObservationStore , ObservationStoreMessageType . GetObservationResponse . toString ( ) ) ) ; verify ( m_ObservationStore , timeout ( 1000 ) . never ( ) ) . persist ( Mockito . any ( Observation . class ) ) ; ArgumentCaptor < Event > captor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( captor . capture ( ) ) ; assertThat ( captor . getValue ( ) . getTopic ( ) , is ( RemoteEventConstants . TOPIC_OBS_STORE_RETRIEVE_COMPLETE ) ) ; assertThat ( ( Integer ) captor . getValue ( ) . getProperty ( RemoteEventConstants . EVENT_PROP_OBS_NUMBER_RETRIEVED ) , is ( 0 ) ) ; }
Test loading get observation response data.
Test loading get observation response data .
//verify push event