mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetMgrImpl.java
@Test
    public void testHandleRemoteAssetEventFactoryObjPidCreated()
    {
        //load assets for one system
        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 a status
        final Map<String, Object> props = new HashMap<String, Object>();
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_NAME, "name");
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_UUID, uuid2.toString());
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_TYPE, Asset.class.getName());
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_PID, "PIDGEON");
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE, "Asset");
        props.put(RemoteConstants.REMOTE_EVENT_PROP_CONTROLLER_ID, systemId1);
        Event event = new Event(FactoryDescriptor.TOPIC_FACTORY_OBJ_PID_CREATED + 
                RemoteConstants.REMOTE_TOPIC_SUFFIX, props);
        
        m_EventHelper.handleEvent(event);
        
        List<AssetModel> models = m_SUT.getAssetsForControllerAsync(systemId1);
        assertThat(models.size(), is(2));
        
        boolean found = false;
        for(AssetModel model : models)
        {
            if (model.getUuid().equals(uuid2))
            {
                assertThat(model.getPid(), is("PIDGEON"));
                found = true;
            }
        }
        
        assertThat(found, is(true));    
    }
/**
     * Verify that an object's pid can be updated.
     */
Verify that an object's pid can be updated.
Verify that an object ' s pid can be updated .
@Test
    public void testHandleRemoteAssetEventFactoryObjPidCreated()
    {
        Event getAssetsReponse = mockGetAssetsResponse(systemId1);
        m_AssetDirHelper.handleEvent(getAssetsReponse);
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).size(), is(2));
        final Map<String, Object> props = new HashMap<String, Object>();
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_NAME, "name");
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_UUID, uuid2.toString());
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_TYPE, Asset.class.getName());
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_PID, "PIDGEON");
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE, "Asset");
        props.put(RemoteConstants.REMOTE_EVENT_PROP_CONTROLLER_ID, systemId1);
        Event event = new Event(FactoryDescriptor.TOPIC_FACTORY_OBJ_PID_CREATED + 
                RemoteConstants.REMOTE_TOPIC_SUFFIX, props);
        m_EventHelper.handleEvent(event);
        List<AssetModel> models = m_SUT.getAssetsForControllerAsync(systemId1);
        assertThat(models.size(), is(2));
        boolean found = false;
        for(AssetModel model : models)
        {
            if (model.getUuid().equals(uuid2))
            {
                assertThat(model.getPid(), is("PIDGEON"));
                found = true;
            }
        }
        assertThat(found, is(true));    
    }
@ Test public void testHandleRemoteAssetEventFactoryObjPidCreated ( ) { Event getAssetsReponse = mockGetAssetsResponse ( systemId1 ) ; m_AssetDirHelper . handleEvent ( getAssetsReponse ) ; assertThat ( m_SUT . getAssetsForControllerAsync ( systemId1 ) . size ( ) , is ( 2 ) ) ; final Map < String , Object > props = new HashMap < String , Object > ( ) ; props . put ( FactoryDescriptor . EVENT_PROP_OBJ_NAME , "name" ) ; props . put ( FactoryDescriptor . EVENT_PROP_OBJ_UUID , uuid2 . toString ( ) ) ; props . put ( FactoryDescriptor . EVENT_PROP_OBJ_TYPE , Asset . class . getName ( ) ) ; props . put ( FactoryDescriptor . EVENT_PROP_OBJ_PID , "PIDGEON" ) ; props . put ( FactoryDescriptor . EVENT_PROP_OBJ_BASE_TYPE , "Asset" ) ; props . put ( RemoteConstants . REMOTE_EVENT_PROP_CONTROLLER_ID , systemId1 ) ; Event event = new Event ( FactoryDescriptor . TOPIC_FACTORY_OBJ_PID_CREATED + RemoteConstants . REMOTE_TOPIC_SUFFIX , props ) ; m_EventHelper . handleEvent ( event ) ; List < AssetModel > models = m_SUT . getAssetsForControllerAsync ( systemId1 ) ; assertThat ( models . size ( ) , is ( 2 ) ) ; boolean found = false ; for ( AssetModel model : models ) { if ( model . getUuid ( ) . equals ( uuid2 ) ) { assertThat ( model . getPid ( ) , is ( "PIDGEON" ) ) ; found = true ; } } assertThat ( found , is ( true ) ) ; }
Verify that an object's pid can be updated.
Verify that an object ' s pid can be updated .
//load assets for one system //this should render two assets for the system id //verify assets added //create a status