mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/ccomms/TestPhysicalLinkMessageService.java
@Test
    public void testIsOpenResponse() throws IOException
    {
        Message response = IsOpenResponseData.newBuilder()
                .setIsOpen(true)
                .build();
        
        PhysicalLinkNamespace physicalMessage = PhysicalLinkNamespace.newBuilder()
                .setType(PhysicalLinkMessageType.IsOpenResponse)
                .setData(response.toByteString())
                .build();
        
        TerraHarvestMessage message = createPhysicalLinkMessage(physicalMessage);
        TerraHarvestPayload payload = createPayload(physicalMessage);

        // mock the channel the message came from
        RemoteChannel channel = mock(RemoteChannel.class);
        
        m_SUT.handleMessage(message, payload, channel);
        
        // verify event is posted
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event event = eventCaptor.getValue();
        
        assertThat((Message)event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(response));
    }
/**
     * Verify event posted for response message, verify event property key in the posted event is the correct response 
     * for the message that was sent.
     */
Verify event posted for response message, verify event property key in the posted event is the correct response
for the message that was sent.
Verify event posted for response message verify event property key in the posted event is the correct response for the message that was sent .
@Test
    public void testIsOpenResponse() throws IOException
    {
        Message response = IsOpenResponseData.newBuilder()
                .setIsOpen(true)
                .build();
        PhysicalLinkNamespace physicalMessage = PhysicalLinkNamespace.newBuilder()
                .setType(PhysicalLinkMessageType.IsOpenResponse)
                .setData(response.toByteString())
                .build();
        TerraHarvestMessage message = createPhysicalLinkMessage(physicalMessage);
        TerraHarvestPayload payload = createPayload(physicalMessage);
        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((Message)event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(response));
    }
@ Test public void testIsOpenResponse ( ) throws IOException { Message response = IsOpenResponseData . newBuilder ( ) . setIsOpen ( true ) . build ( ) ; PhysicalLinkNamespace physicalMessage = PhysicalLinkNamespace . newBuilder ( ) . setType ( PhysicalLinkMessageType . IsOpenResponse ) . setData ( response . toByteString ( ) ) . build ( ) ; TerraHarvestMessage message = createPhysicalLinkMessage ( physicalMessage ) ; TerraHarvestPayload payload = createPayload ( physicalMessage ) ; 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 ( ( Message ) event . getProperty ( RemoteConstants . EVENT_PROP_DATA_MESSAGE ) , is ( response ) ) ; }
Verify event posted for response message, verify event property key in the posted event is the correct response
 for the message that was sent.
Verify event posted for response message verify event property key in the posted event is the correct response for the message that was sent .
// mock the channel the message came from // verify event is posted