mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestAbstractFactoryObject.java
@Test
    public void testPostEventNoAddProps()
    {
        m_SUT.postEvent("some-event", null);
        
        ArgumentCaptor<Event> event = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(event.capture());
        
        assertThat(event.getValue().getTopic(), is("some-event"));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ_TYPE));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ_NAME));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ_PID));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ_UUID));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE));
    }
/**
     * Verify properties are posted properly if null is passed for additional properties.
     */
Verify properties are posted properly if null is passed for additional properties.
Verify properties are posted properly if null is passed for additional properties .
@Test
    public void testPostEventNoAddProps()
    {
        m_SUT.postEvent("some-event", null);
        ArgumentCaptor<Event> event = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(event.capture());
        assertThat(event.getValue().getTopic(), is("some-event"));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ_TYPE));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ_NAME));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ_PID));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ_UUID));
        assertThat(event.getValue().getPropertyNames(), hasItemInArray(FactoryDescriptor.EVENT_PROP_OBJ_BASE_TYPE));
    }
@ Test public void testPostEventNoAddProps ( ) { m_SUT . postEvent ( "some-event" , null ) ; ArgumentCaptor < Event > event = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( event . capture ( ) ) ; assertThat ( event . getValue ( ) . getTopic ( ) , is ( "some-event" ) ) ; assertThat ( event . getValue ( ) . getPropertyNames ( ) , hasItemInArray ( FactoryDescriptor . EVENT_PROP_OBJ ) ) ; assertThat ( event . getValue ( ) . getPropertyNames ( ) , hasItemInArray ( FactoryDescriptor . EVENT_PROP_OBJ_TYPE ) ) ; assertThat ( event . getValue ( ) . getPropertyNames ( ) , hasItemInArray ( FactoryDescriptor . EVENT_PROP_OBJ_NAME ) ) ; assertThat ( event . getValue ( ) . getPropertyNames ( ) , hasItemInArray ( FactoryDescriptor . EVENT_PROP_OBJ_PID ) ) ; assertThat ( event . getValue ( ) . getPropertyNames ( ) , hasItemInArray ( FactoryDescriptor . EVENT_PROP_OBJ_UUID ) ) ; assertThat ( event . getValue ( ) . getPropertyNames ( ) , hasItemInArray ( FactoryDescriptor . EVENT_PROP_OBJ_BASE_TYPE ) ) ; }
Verify properties are posted properly if null is passed for additional properties.
Verify properties are posted properly if null is passed for additional properties .