mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/observation/TestRetrieveDeleteObsHelperImpl.java
@Test
    public void testRemoteRetrievalOneAsset()
    {
        //asset uuid
        UUID assetUUID = UUID.randomUUID();
        
        //asset model mocks
        AssetModel asset1 = mock(AssetModel.class);
        when(asset1.getUuid()).thenReturn(assetUUID);
        
        //request for observations
        m_SUT.submitRetrieveObservationsRequest(asset1);
        
        //verify call to remote message sender
        ArgumentCaptor<Message> messageCaptor = ArgumentCaptor.forClass(Message.class);
        //should be one request
        verify(m_MessageFactory).createObservationStoreMessage(
            eq(ObservationStoreMessageType.GetObservationRequest), messageCaptor.capture());
        verify(m_MessageWrapper).queue(eq(CONTROLLER_ID), eq((ResponseHandler)null));
        
        //verify data messages
        GetObservationRequestData requestData = (GetObservationRequestData)messageCaptor.getAllValues().get(0);
        Query query = requestData.getObsQuery();
        assertThat(query.hasMaxNumberOfObs(), is(false));
        assertThat(query.hasCreatedTimeRange(), is(false));
        assertThat(query.getAssetUuid(), is(SharedMessageUtils.convertUUIDToProtoUUID(assetUUID)));
    }
/**
     * Verify the remote request to retrieve Observations for a single asset.
     */
Verify the remote request to retrieve Observations for a single asset.
Verify the remote request to retrieve Observations for a single asset .
@Test
    public void testRemoteRetrievalOneAsset()
    {
        UUID assetUUID = UUID.randomUUID();
        AssetModel asset1 = mock(AssetModel.class);
        when(asset1.getUuid()).thenReturn(assetUUID);
        m_SUT.submitRetrieveObservationsRequest(asset1);
        ArgumentCaptor<Message> messageCaptor = ArgumentCaptor.forClass(Message.class);
        verify(m_MessageFactory).createObservationStoreMessage(
            eq(ObservationStoreMessageType.GetObservationRequest), messageCaptor.capture());
        verify(m_MessageWrapper).queue(eq(CONTROLLER_ID), eq((ResponseHandler)null));
        GetObservationRequestData requestData = (GetObservationRequestData)messageCaptor.getAllValues().get(0);
        Query query = requestData.getObsQuery();
        assertThat(query.hasMaxNumberOfObs(), is(false));
        assertThat(query.hasCreatedTimeRange(), is(false));
        assertThat(query.getAssetUuid(), is(SharedMessageUtils.convertUUIDToProtoUUID(assetUUID)));
    }
@ Test public void testRemoteRetrievalOneAsset ( ) { UUID assetUUID = UUID . randomUUID ( ) ; AssetModel asset1 = mock ( AssetModel . class ) ; when ( asset1 . getUuid ( ) ) . thenReturn ( assetUUID ) ; m_SUT . submitRetrieveObservationsRequest ( asset1 ) ; ArgumentCaptor < Message > messageCaptor = ArgumentCaptor . forClass ( Message . class ) ; verify ( m_MessageFactory ) . createObservationStoreMessage ( eq ( ObservationStoreMessageType . GetObservationRequest ) , messageCaptor . capture ( ) ) ; verify ( m_MessageWrapper ) . queue ( eq ( CONTROLLER_ID ) , eq ( ( ResponseHandler ) null ) ) ; GetObservationRequestData requestData = ( GetObservationRequestData ) messageCaptor . getAllValues ( ) . get ( 0 ) ; Query query = requestData . getObsQuery ( ) ; assertThat ( query . hasMaxNumberOfObs ( ) , is ( false ) ) ; assertThat ( query . hasCreatedTimeRange ( ) , is ( false ) ) ; assertThat ( query . getAssetUuid ( ) , is ( SharedMessageUtils . convertUUIDToProtoUUID ( assetUUID ) ) ) ; }
Verify the remote request to retrieve Observations for a single asset.
Verify the remote request to retrieve Observations for a single asset .
//asset uuid //asset model mocks //request for observations //verify call to remote message sender //should be one request //verify data messages