mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/base/TestBaseMessageService.java
@Test
    public void testSetSystemStatusResponse() throws IOException, BundleException
    {
        // construct the response message
        BaseNamespace baseNamespaceMessage = BaseNamespace.newBuilder()
                .setType(BaseMessageType.SetOperationModeResponse)
                .build();
        TerraHarvestPayload payload = createPayload(baseNamespaceMessage);
     
        TerraHarvestMessage message = createBaseMessage(baseNamespaceMessage);
        
        // mock the channel the message came from
        RemoteChannel channel = mock(RemoteChannel.class);

        // replay
        m_SUT.handleMessage(message, payload, channel);

        // verify event is posted
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        assertThat((String)eventCaptor.getValue().getProperty(RemoteConstants.EVENT_PROP_MESSAGE_TYPE), 
            is(baseNamespaceMessage.getType().toString()));
    }
/**
     * Verify handling of set system status response.
     */
Verify handling of set system status response.
Verify handling of set system status response .
@Test
    public void testSetSystemStatusResponse() throws IOException, BundleException
    {
        BaseNamespace baseNamespaceMessage = BaseNamespace.newBuilder()
                .setType(BaseMessageType.SetOperationModeResponse)
                .build();
        TerraHarvestPayload payload = createPayload(baseNamespaceMessage);
        TerraHarvestMessage message = createBaseMessage(baseNamespaceMessage);
        RemoteChannel channel = mock(RemoteChannel.class);
        m_SUT.handleMessage(message, payload, channel);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        assertThat((String)eventCaptor.getValue().getProperty(RemoteConstants.EVENT_PROP_MESSAGE_TYPE), 
            is(baseNamespaceMessage.getType().toString()));
    }
@ Test public void testSetSystemStatusResponse ( ) throws IOException , BundleException { BaseNamespace baseNamespaceMessage = BaseNamespace . newBuilder ( ) . setType ( BaseMessageType . SetOperationModeResponse ) . build ( ) ; TerraHarvestPayload payload = createPayload ( baseNamespaceMessage ) ; TerraHarvestMessage message = createBaseMessage ( baseNamespaceMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; m_SUT . handleMessage ( message , payload , channel ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( eventCaptor . capture ( ) ) ; assertThat ( ( String ) eventCaptor . getValue ( ) . getProperty ( RemoteConstants . EVENT_PROP_MESSAGE_TYPE ) , is ( baseNamespaceMessage . getType ( ) . toString ( ) ) ) ; }
Verify handling of set system status response.
Verify handling of set system status response .
// construct the response message // mock the channel the message came from // replay // verify event is posted