mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/osgi/TestEventAdminMessageService.java
@Test
    public void testUnregisterResponse() throws Exception
    {
        EventAdminNamespace eventAdminMessage = EventAdminNamespace.newBuilder().
                setType(EventAdminMessageType.UnregisterEventResponse).
                build();
        
        TerraHarvestMessage message = createEventAdminMessage(eventAdminMessage);
        TerraHarvestPayload payload = createPayload(eventAdminMessage);
        
        // mock the channel the message came from
        RemoteChannel channel = mock(RemoteChannel.class);
        
        // replay
        m_SUT.handleMessage(message, payload, channel);
        
        // verify the event contains the null data message
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        
        Event event = eventCaptor.getValue();
        assertThat(event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(nullValue()));
    }
/**
     * Verify the unregister response message sends an event with null data message.
     */
Verify the unregister response message sends an event with null data message.
Verify the unregister response message sends an event with null data message .
@Test
    public void testUnregisterResponse() throws Exception
    {
        EventAdminNamespace eventAdminMessage = EventAdminNamespace.newBuilder().
                setType(EventAdminMessageType.UnregisterEventResponse).
                build();
        TerraHarvestMessage message = createEventAdminMessage(eventAdminMessage);
        TerraHarvestPayload payload = createPayload(eventAdminMessage);
        RemoteChannel channel = mock(RemoteChannel.class);
        m_SUT.handleMessage(message, payload, channel);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event event = eventCaptor.getValue();
        assertThat(event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(nullValue()));
    }
@ Test public void testUnregisterResponse ( ) throws Exception { EventAdminNamespace eventAdminMessage = EventAdminNamespace . newBuilder ( ) . setType ( EventAdminMessageType . UnregisterEventResponse ) . build ( ) ; TerraHarvestMessage message = createEventAdminMessage ( eventAdminMessage ) ; TerraHarvestPayload payload = createPayload ( eventAdminMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; m_SUT . handleMessage ( message , payload , channel ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( eventCaptor . capture ( ) ) ; Event event = eventCaptor . getValue ( ) ; assertThat ( event . getProperty ( RemoteConstants . EVENT_PROP_DATA_MESSAGE ) , is ( nullValue ( ) ) ) ; }
Verify the unregister response message sends an event with null data message.
Verify the unregister response message sends an event with null data message .
// mock the channel the message came from // replay // verify the event contains the null data message