mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetMgrImpl.java
@Test
    public void testHandleGetAssetsEvent()
    {
        Event getAssetsReponse = mockGetAssetsResponse(systemId1);
        
        //this should render two assets for the system id
        m_AssetDirHelper.handleEvent(getAssetsReponse);
        
        //verify request for asset info
        verify(m_MessageFactory, times(2)).createAssetMessage(
                eq(AssetMessageType.GetActiveStatusRequest),
                Mockito.any(Message.class));
        verify(m_MessageWrapper, times(7)).queue(eq(systemId1), (ResponseHandler) eq(null));
        
        verify(m_MessageFactory, times(2)).createAssetMessage(
                eq(AssetMessageType.GetNameRequest),
                Mockito.any(Message.class));
        verify(m_MessageWrapper, times(7)).queue(eq(systemId1), (ResponseHandler) eq(null));

        //verify assets added to the controller id
        List<AssetModel> models = m_SUT.getAssetsForControllerAsync(systemId1);
        assertThat(models.size(), is(2));
        //verify the integrity of the models
        for (AssetModel model : models)
        {
            if (model.getUuid().equals(uuid1))
            {
                assertThat(model.getPid(), is(pid1));
            }
            else
            {
                assertThat(model.getUuid(), is(uuid2));
                assertThat(model.getPid(), is(pid2));
            }
        }
    }
/**
     * Test the handling of get assets event.
     * Verify assets are added.
     * Verify additional requests for information are sent.
     */
Test the handling of get assets event.
Verify assets are added.
Verify additional requests for information are sent.
Test the handling of get assets event . Verify assets are added . Verify additional requests for information are sent .
@Test
    public void testHandleGetAssetsEvent()
    {
        Event getAssetsReponse = mockGetAssetsResponse(systemId1);
        m_AssetDirHelper.handleEvent(getAssetsReponse);
        verify(m_MessageFactory, times(2)).createAssetMessage(
                eq(AssetMessageType.GetActiveStatusRequest),
                Mockito.any(Message.class));
        verify(m_MessageWrapper, times(7)).queue(eq(systemId1), (ResponseHandler) eq(null));
        verify(m_MessageFactory, times(2)).createAssetMessage(
                eq(AssetMessageType.GetNameRequest),
                Mockito.any(Message.class));
        verify(m_MessageWrapper, times(7)).queue(eq(systemId1), (ResponseHandler) eq(null));
        List<AssetModel> models = m_SUT.getAssetsForControllerAsync(systemId1);
        assertThat(models.size(), is(2));
        for (AssetModel model : models)
        {
            if (model.getUuid().equals(uuid1))
            {
                assertThat(model.getPid(), is(pid1));
            }
            else
            {
                assertThat(model.getUuid(), is(uuid2));
                assertThat(model.getPid(), is(pid2));
            }
        }
    }
@ Test public void testHandleGetAssetsEvent ( ) { Event getAssetsReponse = mockGetAssetsResponse ( systemId1 ) ; m_AssetDirHelper . handleEvent ( getAssetsReponse ) ; verify ( m_MessageFactory , times ( 2 ) ) . createAssetMessage ( eq ( AssetMessageType . GetActiveStatusRequest ) , Mockito . any ( Message . class ) ) ; verify ( m_MessageWrapper , times ( 7 ) ) . queue ( eq ( systemId1 ) , ( ResponseHandler ) eq ( null ) ) ; verify ( m_MessageFactory , times ( 2 ) ) . createAssetMessage ( eq ( AssetMessageType . GetNameRequest ) , Mockito . any ( Message . class ) ) ; verify ( m_MessageWrapper , times ( 7 ) ) . queue ( eq ( systemId1 ) , ( ResponseHandler ) eq ( null ) ) ; List < AssetModel > models = m_SUT . getAssetsForControllerAsync ( systemId1 ) ; assertThat ( models . size ( ) , is ( 2 ) ) ; for ( AssetModel model : models ) { if ( model . getUuid ( ) . equals ( uuid1 ) ) { assertThat ( model . getPid ( ) , is ( pid1 ) ) ; } else { assertThat ( model . getUuid ( ) , is ( uuid2 ) ) ; assertThat ( model . getPid ( ) , is ( pid2 ) ) ; } } }
Test the handling of get assets event.
Test the handling of get assets event .
//this should render two assets for the system id //verify request for asset info //verify assets added to the controller id //verify the integrity of the models