mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestSelectedAssetImpl.java
@Test
    public void testDeactivationRequest()
    {
        //create mock asset model
        AssetModel model = mock(AssetModel.class);
        when(model.getUuid()).thenReturn(uuid);
        when(model.getControllerId()).thenReturn(systemId);
        
        //handle request
        m_SUT.requestDeactivation(model);
        
        //verify message sent, should be deactivate since the model represents the asset already being activated
        ArgumentCaptor<DeactivateRequestData> deactivateReq = 
            ArgumentCaptor.forClass(DeactivateRequestData.class);

        verify(m_MessageFactory).createAssetMessage(
            eq(AssetMessageType.DeactivateRequest), deactivateReq.capture());
        verify(m_MessageWrapper).queue(eq(systemId), (ResponseHandler) eq(null));
        
        //get message
        DeactivateRequestData request = deactivateReq.getValue();

        //verify
        assertThat(request.getUuid(), is(SharedMessageUtils.convertUUIDToProtoUUID(uuid)));
        
        //Verify that the selected asset is returned to null after the request.
        assertThat(m_SUT.getSelectedAssetForDialog(), is(nullValue()));
    }
/**
     * Test the request to deactivate an asset.
     * Verify the correct request is sent.
     */
Test the request to deactivate an asset.
Verify the correct request is sent.
Test the request to deactivate an asset . Verify the correct request is sent .
@Test
    public void testDeactivationRequest()
    {
        AssetModel model = mock(AssetModel.class);
        when(model.getUuid()).thenReturn(uuid);
        when(model.getControllerId()).thenReturn(systemId);
        m_SUT.requestDeactivation(model);
        ArgumentCaptor<DeactivateRequestData> deactivateReq = 
            ArgumentCaptor.forClass(DeactivateRequestData.class);
        verify(m_MessageFactory).createAssetMessage(
            eq(AssetMessageType.DeactivateRequest), deactivateReq.capture());
        verify(m_MessageWrapper).queue(eq(systemId), (ResponseHandler) eq(null));
        DeactivateRequestData request = deactivateReq.getValue();
        assertThat(request.getUuid(), is(SharedMessageUtils.convertUUIDToProtoUUID(uuid)));
        assertThat(m_SUT.getSelectedAssetForDialog(), is(nullValue()));
    }
@ Test public void testDeactivationRequest ( ) { AssetModel model = mock ( AssetModel . class ) ; when ( model . getUuid ( ) ) . thenReturn ( uuid ) ; when ( model . getControllerId ( ) ) . thenReturn ( systemId ) ; m_SUT . requestDeactivation ( model ) ; ArgumentCaptor < DeactivateRequestData > deactivateReq = ArgumentCaptor . forClass ( DeactivateRequestData . class ) ; verify ( m_MessageFactory ) . createAssetMessage ( eq ( AssetMessageType . DeactivateRequest ) , deactivateReq . capture ( ) ) ; verify ( m_MessageWrapper ) . queue ( eq ( systemId ) , ( ResponseHandler ) eq ( null ) ) ; DeactivateRequestData request = deactivateReq . getValue ( ) ; assertThat ( request . getUuid ( ) , is ( SharedMessageUtils . convertUUIDToProtoUUID ( uuid ) ) ) ; assertThat ( m_SUT . getSelectedAssetForDialog ( ) , is ( nullValue ( ) ) ) ; }
Test the request to deactivate an asset.
Test the request to deactivate an asset .
//create mock asset model //handle request //verify message sent, should be deactivate since the model represents the asset already being activated //get message //verify //Verify that the selected asset is returned to null after the request.