mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestSelectedAssetImpl.java
@Test
    public void testRequestCaptureData()
    {
        //create mock asset model
        AssetModel model = mock(AssetModel.class);
        when(model.getUuid()).thenReturn(uuid);
        when(model.getControllerId()).thenReturn(systemId);
        
        m_SUT.requestCaptureData(model);
        
        //verify message sent to request the data capturing
        ArgumentCaptor<CaptureDataRequestData> request = 
            ArgumentCaptor.forClass(CaptureDataRequestData.class);

        verify(m_MessageFactory).createAssetMessage(eq(AssetMessageType.CaptureDataRequest), request.capture());
        verify(m_MessageWrapper).queue(eq(systemId), (ResponseHandler) eq(null));

        //get message
        CaptureDataRequestData requestCapture = request.getValue();
        
        //verify
        assertThat(requestCapture.getUuid(), is(SharedMessageUtils.convertUUIDToProtoUUID(uuid)));
        assertThat(requestCapture.getObservationFormat(), is(RemoteTypesGen.LexiconFormat.Enum.UUID_ONLY));
        
        //Verify that the selected asset is returned to null after the request.
        assertThat(m_SUT.getSelectedAssetForDialog(), is(nullValue()));
    }
/**
     * Test the request for an asset to capture data.
     * Verify message sent.
     */
Test the request for an asset to capture data.
Verify message sent.
Test the request for an asset to capture data . Verify message sent .
@Test
    public void testRequestCaptureData()
    {
        AssetModel model = mock(AssetModel.class);
        when(model.getUuid()).thenReturn(uuid);
        when(model.getControllerId()).thenReturn(systemId);
        m_SUT.requestCaptureData(model);
        ArgumentCaptor<CaptureDataRequestData> request = 
            ArgumentCaptor.forClass(CaptureDataRequestData.class);
        verify(m_MessageFactory).createAssetMessage(eq(AssetMessageType.CaptureDataRequest), request.capture());
        verify(m_MessageWrapper).queue(eq(systemId), (ResponseHandler) eq(null));
        CaptureDataRequestData requestCapture = request.getValue();
        assertThat(requestCapture.getUuid(), is(SharedMessageUtils.convertUUIDToProtoUUID(uuid)));
        assertThat(requestCapture.getObservationFormat(), is(RemoteTypesGen.LexiconFormat.Enum.UUID_ONLY));
        assertThat(m_SUT.getSelectedAssetForDialog(), is(nullValue()));
    }
@ Test public void testRequestCaptureData ( ) { AssetModel model = mock ( AssetModel . class ) ; when ( model . getUuid ( ) ) . thenReturn ( uuid ) ; when ( model . getControllerId ( ) ) . thenReturn ( systemId ) ; m_SUT . requestCaptureData ( model ) ; ArgumentCaptor < CaptureDataRequestData > request = ArgumentCaptor . forClass ( CaptureDataRequestData . class ) ; verify ( m_MessageFactory ) . createAssetMessage ( eq ( AssetMessageType . CaptureDataRequest ) , request . capture ( ) ) ; verify ( m_MessageWrapper ) . queue ( eq ( systemId ) , ( ResponseHandler ) eq ( null ) ) ; CaptureDataRequestData requestCapture = request . getValue ( ) ; assertThat ( requestCapture . getUuid ( ) , is ( SharedMessageUtils . convertUUIDToProtoUUID ( uuid ) ) ) ; assertThat ( requestCapture . getObservationFormat ( ) , is ( RemoteTypesGen . LexiconFormat . Enum . UUID_ONLY ) ) ; assertThat ( m_SUT . getSelectedAssetForDialog ( ) , is ( nullValue ( ) ) ) ; }
Test the request for an asset to capture data.
Test the request for an asset to capture data .
//create mock asset model //verify message sent to request the data capturing //get message //verify //Verify that the selected asset is returned to null after the request.