mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestFactoryServiceUtils.java
@Test
    public void testGetFactoryObjectBaseEventPropsNullPid()
    {
        UUID uuid = UUID.randomUUID(); 
        
        FactoryObjectInternal objectNoPid = mock(FactoryObjectInternal.class);
        when(objectNoPid.getFactory()).thenReturn(m_Factory);
        when(objectNoPid.getName()).thenReturn("factObjName");
        when(objectNoPid.getUuid()).thenReturn(uuid);
        when(objectNoPid.getBaseType()).thenReturn(BASE_TYPE);
                       
        Map<String, Object> props = FactoryServiceUtils.getFactoryObjectBaseEventProps(objectNoPid);
        
        assertThat(props.size(), is(5));
        assertThat(props.containsKey(FactoryDescriptor.EVENT_PROP_OBJ_PID), is(false));
        assertThat((FactoryObjectInternal)props.get(FactoryDescriptor.EVENT_PROP_OBJ), is(objectNoPid));
        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 testGetFactoryObjectBaseEventPropsNullPid()
    {
        UUID uuid = UUID.randomUUID(); 
        FactoryObjectInternal objectNoPid = mock(FactoryObjectInternal.class);
        when(objectNoPid.getFactory()).thenReturn(m_Factory);
        when(objectNoPid.getName()).thenReturn("factObjName");
        when(objectNoPid.getUuid()).thenReturn(uuid);
        when(objectNoPid.getBaseType()).thenReturn(BASE_TYPE);
        Map<String, Object> props = FactoryServiceUtils.getFactoryObjectBaseEventProps(objectNoPid);
        assertThat(props.size(), is(5));
        assertThat(props.containsKey(FactoryDescriptor.EVENT_PROP_OBJ_PID), is(false));
        assertThat((FactoryObjectInternal)props.get(FactoryDescriptor.EVENT_PROP_OBJ), is(objectNoPid));
        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 testGetFactoryObjectBaseEventPropsNullPid ( ) { UUID uuid = UUID . randomUUID ( ) ; FactoryObjectInternal objectNoPid = mock ( FactoryObjectInternal . class ) ; when ( objectNoPid . getFactory ( ) ) . thenReturn ( m_Factory ) ; when ( objectNoPid . getName ( ) ) . thenReturn ( "factObjName" ) ; when ( objectNoPid . getUuid ( ) ) . thenReturn ( uuid ) ; when ( objectNoPid . getBaseType ( ) ) . thenReturn ( BASE_TYPE ) ; Map < String , Object > props = FactoryServiceUtils . getFactoryObjectBaseEventProps ( objectNoPid ) ; assertThat ( props . size ( ) , is ( 5 ) ) ; assertThat ( props . containsKey ( FactoryDescriptor . EVENT_PROP_OBJ_PID ) , is ( false ) ) ; assertThat ( ( FactoryObjectInternal ) props . get ( FactoryDescriptor . EVENT_PROP_OBJ ) , is ( objectNoPid ) ) ; 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 .