mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetMgrImpl.java
@Test
    public void testHandleGetStatusResponseNoSummaryDescription() throws ObjectConverterException
    {
        //make some assets
        Event getAssetsReponse = mockGetAssetsResponse(systemId1);
        
        //this should render two assets for the system id
        m_AssetDirHelper.handleEvent(getAssetsReponse);

        //verify assets added
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).size(), is(2));

        //create asset appropriate event for the asset status update
        Event getStatusResponse = mockGetStatusResponseNoStatus(systemId1);

        //handle event
        m_AssetHelper.handleEvent(getStatusResponse);

        //verify
        List<AssetModel> models = m_SUT.getAssetsForControllerAsync(systemId1);
        
        //verify that the asset with uuid1 is updated with appropriate status
        boolean verified = false;
        for (AssetModel model : models)
        {
            if (model.getUuid().equals(uuid1))
            {
                assertThat(model.getPid(), is(pid1));
                assertThat(model.getSummaryStatus(), is(nullValue()));
                assertThat(model.getSummaryDescription(), is(""));
                verified = true;
            }
        }
        
        //verify both assets were checked
        assertThat(verified, is(true));
        
        verify(m_EventAdmin, never()).postEvent(Mockito.any(Event.class));
    }
/**
     * Test the handling of get status request response is still handled if the summary description is an empty string. 
     * Verify the status is updated. (The mock message only updates the asset with uuid1).
     */
Test the handling of get status request response is still handled if the summary description is an empty string.
Verify the status is updated. (The mock message only updates the asset with uuid1).
Test the handling of get status request response is still handled if the summary description is an empty string . Verify the status is updated . ( The mock message only updates the asset with uuid1 ) .
@Test
    public void testHandleGetStatusResponseNoSummaryDescription() throws ObjectConverterException
    {
        Event getAssetsReponse = mockGetAssetsResponse(systemId1);
        m_AssetDirHelper.handleEvent(getAssetsReponse);
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).size(), is(2));
        Event getStatusResponse = mockGetStatusResponseNoStatus(systemId1);
        m_AssetHelper.handleEvent(getStatusResponse);
        List<AssetModel> models = m_SUT.getAssetsForControllerAsync(systemId1);
         that the asset with uuid1 is updated with appropriate status
        boolean verified = false;
        for (AssetModel model : models)
        {
            if (model.getUuid().equals(uuid1))
            {
                assertThat(model.getPid(), is(pid1));
                assertThat(model.getSummaryStatus(), is(nullValue()));
                assertThat(model.getSummaryDescription(), is(""));
                verified = true;
            }
        }
         both assets were checked
        assertThat(verified, is(true));
        verify(m_EventAdmin, never()).postEvent(Mockito.any(Event.class));
    }
@ Test public void testHandleGetStatusResponseNoSummaryDescription ( ) throws ObjectConverterException { Event getAssetsReponse = mockGetAssetsResponse ( systemId1 ) ; m_AssetDirHelper . handleEvent ( getAssetsReponse ) ; assertThat ( m_SUT . getAssetsForControllerAsync ( systemId1 ) . size ( ) , is ( 2 ) ) ; Event getStatusResponse = mockGetStatusResponseNoStatus ( systemId1 ) ; m_AssetHelper . handleEvent ( getStatusResponse ) ; List < AssetModel > models = m_SUT . getAssetsForControllerAsync ( systemId1 ) ; boolean verified = false ; for ( AssetModel model : models ) { if ( model . getUuid ( ) . equals ( uuid1 ) ) { assertThat ( model . getPid ( ) , is ( pid1 ) ) ; assertThat ( model . getSummaryStatus ( ) , is ( nullValue ( ) ) ) ; assertThat ( model . getSummaryDescription ( ) , is ( "" ) ) ; verified = true ; } } assertThat ( verified , is ( true ) ) ; verify ( m_EventAdmin , never ( ) ) . postEvent ( Mockito . any ( Event . class ) ) ; }
Test the handling of get status request response is still handled if the summary description is an empty string.
Test the handling of get status request response is still handled if the summary description is an empty string .
//make some assets //this should render two assets for the system id //verify assets added //create asset appropriate event for the asset status update //handle event //verify //verify that the asset with uuid1 is updated with appropriate status //verify both assets were checked