mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetMgrImpl.java
@Test 
    public void testHandleRemoteEventDataCapturedWithoutObservationUUID()
    {
        //load assets for one system
        Event getAssetsReponse = mockGetAssetsResponse(1);
        
        //this should render two assets for the system id
        m_AssetDirHelper.handleEvent(getAssetsReponse);
        
        //verify assets added
        assertThat(m_SUT.getAssetsForControllerAsync(1).size(), is(2));
        
        // properties for the event
        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, "PID");
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE, "Asset");
        props.put(RemoteConstants.REMOTE_EVENT_PROP_CONTROLLER_ID, 1);
        Event mockedCapData = new Event(Asset.TOPIC_DATA_CAPTURED + RemoteConstants.REMOTE_TOPIC_SUFFIX, props);
        
        m_EventHelper.handleEvent(mockedCapData);
        
        ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(captor.capture());
        
        assertThat(captor.getValue().getTopic(), is(AssetMgr.TOPIC_ASSET_OBSERVATION_UPDATED));
        assertThat((String)captor.getValue().getProperty(AssetModel.EVENT_PROP_UUID), is(uuid2.toString()));
    }
/**
     * Verify that capture data event causes a event to be fired but does not produce a growl message.
     */
Verify that capture data event causes a event to be fired but does not produce a growl message.
Verify that capture data event causes a event to be fired but does not produce a growl message .
@Test 
    public void testHandleRemoteEventDataCapturedWithoutObservationUUID()
    {
        Event getAssetsReponse = mockGetAssetsResponse(1);
        m_AssetDirHelper.handleEvent(getAssetsReponse);
        assertThat(m_SUT.getAssetsForControllerAsync(1).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, "PID");
        props.put(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE, "Asset");
        props.put(RemoteConstants.REMOTE_EVENT_PROP_CONTROLLER_ID, 1);
        Event mockedCapData = new Event(Asset.TOPIC_DATA_CAPTURED + RemoteConstants.REMOTE_TOPIC_SUFFIX, props);
        m_EventHelper.handleEvent(mockedCapData);
        ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(captor.capture());
        assertThat(captor.getValue().getTopic(), is(AssetMgr.TOPIC_ASSET_OBSERVATION_UPDATED));
        assertThat((String)captor.getValue().getProperty(AssetModel.EVENT_PROP_UUID), is(uuid2.toString()));
    }
@ Test public void testHandleRemoteEventDataCapturedWithoutObservationUUID ( ) { Event getAssetsReponse = mockGetAssetsResponse ( 1 ) ; m_AssetDirHelper . handleEvent ( getAssetsReponse ) ; assertThat ( m_SUT . getAssetsForControllerAsync ( 1 ) . 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 , "PID" ) ; props . put ( FactoryDescriptor . EVENT_PROP_OBJ_BASE_TYPE , "Asset" ) ; props . put ( RemoteConstants . REMOTE_EVENT_PROP_CONTROLLER_ID , 1 ) ; Event mockedCapData = new Event ( Asset . TOPIC_DATA_CAPTURED + RemoteConstants . REMOTE_TOPIC_SUFFIX , props ) ; m_EventHelper . handleEvent ( mockedCapData ) ; ArgumentCaptor < Event > captor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( captor . capture ( ) ) ; assertThat ( captor . getValue ( ) . getTopic ( ) , is ( AssetMgr . TOPIC_ASSET_OBSERVATION_UPDATED ) ) ; assertThat ( ( String ) captor . getValue ( ) . getProperty ( AssetModel . EVENT_PROP_UUID ) , is ( uuid2 . toString ( ) ) ) ; }
Verify that capture data event causes a event to be fired but does not produce a growl message.
Verify that capture data event causes a event to be fired but does not produce a growl message .
//load assets for one system //this should render two assets for the system id //verify assets added // properties for the event