mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestAbstractFactoryObject.java
@Test
    public void testPostEvent()
    {
        m_SUT.postEvent("some-event", new ImmutableMap.Builder<String, Object>().put("key", "value").build());
        
        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));
        assertThat(event.getValue().getProperty("key"), is((Object)"value"));
    }
/**
     * Verify properties are posted properly.
     */
Verify properties are posted properly.
Verify properties are posted properly .
@Test
    public void testPostEvent()
    {
        m_SUT.postEvent("some-event", new ImmutableMap.Builder<String, Object>().put("key", "value").build());
        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));
        assertThat(event.getValue().getProperty("key"), is((Object)"value"));
    }
@ Test public void testPostEvent ( ) { m_SUT . postEvent ( "some-event" , new ImmutableMap . Builder < String , Object > ( ) . put ( "key" , "value" ) . build ( ) ) ; 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 ) ) ; assertThat ( event . getValue ( ) . getProperty ( "key" ) , is ( ( Object ) "value" ) ) ; }
Verify properties are posted properly.
Verify properties are posted properly .