mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetMgrImpl.java
@Test
    public void testHandleObjectNameUpdated()
    {
        //load assets for one system
        Event getAssetsReponse = mockGetAssetsResponse(systemId1);

        //this should render two assets for the system id
        m_AssetDirHelper.handleEvent(getAssetsReponse);

        //get the default name
        List<AssetModel> models = m_SUT.getAssetsForControllerAsync(systemId1);
        
        //should be two models, the model with UUID2 is the model updated
        assertThat(models.size(), is(2));
        String defaultName;
        if (models.get(0).getUuid().equals(uuid2))
        {
            defaultName = models.get(0).getName();
        }
        else
        {
            defaultName = models.get(1).getName();
        }
        
        //handle updated event
        Event objUpdated = mockEventObjectNameUpdated(systemId1);
        
        //this should create a request for updating information
        m_EventHelper.handleEvent(objUpdated);

        //get the asset model that should of been updated
        models = m_SUT.getAssetsForControllerAsync(systemId1);
        
        //should be two models
        assertThat(models.size(), is(2));
        AssetModel model;
        if (models.get(0).getUuid().equals(uuid2))
        {
            model = models.get(0);
        }
        else
        {
            model = models.get(1);
        }
        
        //name should of been updated to "splooosh"
        assertThat(model.getName(), is("splooosh"));
        
        //not pulling any fast ones, verify
        assertThat(defaultName, is(not("splooosh")));
    }
/**
     * Test the handling of object name updated event.
     * Verify that name is updated.
     */
Test the handling of object name updated event.
Verify that name is updated.
Test the handling of object name updated event . Verify that name is updated .
@Test
    public void testHandleObjectNameUpdated()
    {
        Event getAssetsReponse = mockGetAssetsResponse(systemId1);
        m_AssetDirHelper.handleEvent(getAssetsReponse);
        List<AssetModel> models = m_SUT.getAssetsForControllerAsync(systemId1);
        assertThat(models.size(), is(2));
        String defaultName;
        if (models.get(0).getUuid().equals(uuid2))
        {
            defaultName = models.get(0).getName();
        }
        else
        {
            defaultName = models.get(1).getName();
        }
        Event objUpdated = mockEventObjectNameUpdated(systemId1);
        m_EventHelper.handleEvent(objUpdated);
        models = m_SUT.getAssetsForControllerAsync(systemId1);
        assertThat(models.size(), is(2));
        AssetModel model;
        if (models.get(0).getUuid().equals(uuid2))
        {
            model = models.get(0);
        }
        else
        {
            model = models.get(1);
        }
        assertThat(model.getName(), is("splooosh"));
        assertThat(defaultName, is(not("splooosh")));
    }
@ Test public void testHandleObjectNameUpdated ( ) { Event getAssetsReponse = mockGetAssetsResponse ( systemId1 ) ; m_AssetDirHelper . handleEvent ( getAssetsReponse ) ; List < AssetModel > models = m_SUT . getAssetsForControllerAsync ( systemId1 ) ; assertThat ( models . size ( ) , is ( 2 ) ) ; String defaultName ; if ( models . get ( 0 ) . getUuid ( ) . equals ( uuid2 ) ) { defaultName = models . get ( 0 ) . getName ( ) ; } else { defaultName = models . get ( 1 ) . getName ( ) ; } Event objUpdated = mockEventObjectNameUpdated ( systemId1 ) ; m_EventHelper . handleEvent ( objUpdated ) ; models = m_SUT . getAssetsForControllerAsync ( systemId1 ) ; assertThat ( models . size ( ) , is ( 2 ) ) ; AssetModel model ; if ( models . get ( 0 ) . getUuid ( ) . equals ( uuid2 ) ) { model = models . get ( 0 ) ; } else { model = models . get ( 1 ) ; } assertThat ( model . getName ( ) , is ( "splooosh" ) ) ; assertThat ( defaultName , is ( not ( "splooosh" ) ) ) ; }
Test the handling of object name updated event.
Test the handling of object name updated event .
//load assets for one system //this should render two assets for the system id //get the default name //should be two models, the model with UUID2 is the model updated //handle updated event //this should create a request for updating information //get the asset model that should of been updated //should be two models //name should of been updated to "splooosh" //not pulling any fast ones, verify