mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestFactoryServiceUtils.java
@Test
    public void testGetFactoryObjectBaseEventPropsPid()
    {
        UUID uuid = UUID.randomUUID();
        
        FactoryObjectInternal objectPid = mock(FactoryObjectInternal.class);
        when(objectPid.getFactory()).thenReturn(m_Factory);
        when(objectPid.getName()).thenReturn("factObjName");
        when(objectPid.getUuid()).thenReturn(uuid);
        when(objectPid.getPid()).thenReturn("pid");
        when(objectPid.getBaseType()).thenReturn(BASE_TYPE);
        
        Map<String, Object> props = FactoryServiceUtils.getFactoryObjectBaseEventProps(objectPid);
        
        assertThat(props.size(), is(6));
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_PID), is("pid"));
        assertThat((FactoryObjectInternal)props.get(FactoryDescriptor.EVENT_PROP_OBJ), is(objectPid));
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_NAME), is("factObjName"));
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_TYPE), is(PRODUCT_TYPE));
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_UUID), is(uuid.toString()));
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE), 
                is(BASE_TYPE));
    }
/**
     * Verify that the correct event properties are returned based on the given 
     * factory object that is passed in. No PID event property should be returned.
     */
Verify that the correct event properties are returned based on the given
factory object that is passed in. No PID event property should be returned.
Verify that the correct event properties are returned based on the given factory object that is passed in . No PID event property should be returned .
@Test
    public void testGetFactoryObjectBaseEventPropsPid()
    {
        UUID uuid = UUID.randomUUID();
        FactoryObjectInternal objectPid = mock(FactoryObjectInternal.class);
        when(objectPid.getFactory()).thenReturn(m_Factory);
        when(objectPid.getName()).thenReturn("factObjName");
        when(objectPid.getUuid()).thenReturn(uuid);
        when(objectPid.getPid()).thenReturn("pid");
        when(objectPid.getBaseType()).thenReturn(BASE_TYPE);
        Map<String, Object> props = FactoryServiceUtils.getFactoryObjectBaseEventProps(objectPid);
        assertThat(props.size(), is(6));
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_PID), is("pid"));
        assertThat((FactoryObjectInternal)props.get(FactoryDescriptor.EVENT_PROP_OBJ), is(objectPid));
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_NAME), is("factObjName"));
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_TYPE), is(PRODUCT_TYPE));
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_UUID), is(uuid.toString()));
        assertThat((String)props.get(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE), 
                is(BASE_TYPE));
    }
@ Test public void testGetFactoryObjectBaseEventPropsPid ( ) { UUID uuid = UUID . randomUUID ( ) ; FactoryObjectInternal objectPid = mock ( FactoryObjectInternal . class ) ; when ( objectPid . getFactory ( ) ) . thenReturn ( m_Factory ) ; when ( objectPid . getName ( ) ) . thenReturn ( "factObjName" ) ; when ( objectPid . getUuid ( ) ) . thenReturn ( uuid ) ; when ( objectPid . getPid ( ) ) . thenReturn ( "pid" ) ; when ( objectPid . getBaseType ( ) ) . thenReturn ( BASE_TYPE ) ; Map < String , Object > props = FactoryServiceUtils . getFactoryObjectBaseEventProps ( objectPid ) ; assertThat ( props . size ( ) , is ( 6 ) ) ; assertThat ( ( String ) props . get ( FactoryDescriptor . EVENT_PROP_OBJ_PID ) , is ( "pid" ) ) ; assertThat ( ( FactoryObjectInternal ) props . get ( FactoryDescriptor . EVENT_PROP_OBJ ) , is ( objectPid ) ) ; assertThat ( ( String ) props . get ( FactoryDescriptor . EVENT_PROP_OBJ_NAME ) , is ( "factObjName" ) ) ; assertThat ( ( String ) props . get ( FactoryDescriptor . EVENT_PROP_OBJ_TYPE ) , is ( PRODUCT_TYPE ) ) ; assertThat ( ( String ) props . get ( FactoryDescriptor . EVENT_PROP_OBJ_UUID ) , is ( uuid . toString ( ) ) ) ; assertThat ( ( String ) props . get ( FactoryDescriptor . EVENT_PROP_OBJ_BASE_TYPE ) , is ( BASE_TYPE ) ) ; }
Verify that the correct event properties are returned based on the given
 factory object that is passed in.
Verify that the correct event properties are returned based on the given factory object that is passed in .