mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageSenderImpl.java
@Test
    public void testQueueMessageWithConvertToRemoteChannel() throws IOException
    {
        //setup and activate component
        activateSetUp();

        // construct data message to send, should reg handler
        ActivateRequestData messageData = ActivateRequestData.newBuilder().
                setUuid(UUID.newBuilder().setLeastSignificantBits(0L).setMostSignificantBits(1L).build()).build();
        AssetNamespace  nameMessage = AssetNamespace.newBuilder().
                setType(AssetMessageType.ActivateRequest).
                setData(messageData.toByteString()).build();
        TerraHarvestMessage request = 
                createMessageWithDestSource(m_LocalId, m_RemoteId, 0, Namespace.Asset, nameMessage);
        TerraHarvestPayload payload = TerraHarvestPayload.parseFrom(request.getTerraHarvestPayload());
        
        when(m_EncryptService.encryptMessage(Mockito.any(Builder.class), Mockito.any(TerraHarvestPayload.class))).
            thenReturn(request);
        when(m_EventChannel.getRemoteSystemId()).thenReturn(m_RemoteId);
        when(m_EventChannel.queueMessage(Mockito.any(TerraHarvestMessage.class))).thenReturn(true);
        
        final List<RemoteChannel> channelList = new ArrayList<RemoteChannel>();
        channelList.add(m_Channel);
        when(m_RemoteChannelLookup.getChannels(m_RemoteId)).thenReturn(channelList);
        
        m_SUT.queueMessage(m_EventChannel, payload, EncryptType.NONE, null);
        
        verify(m_Channel).queueMessage(request);
    }
/**
     * Verify that the queue message method will check whether there is an available remote channel to the destination
     * if an event channel is passed to the method.
     */
Verify that the queue message method will check whether there is an available remote channel to the destination
if an event channel is passed to the method.
Verify that the queue message method will check whether there is an available remote channel to the destination if an event channel is passed to the method .
@Test
    public void testQueueMessageWithConvertToRemoteChannel() throws IOException
    {
        activateSetUp();
        ActivateRequestData messageData = ActivateRequestData.newBuilder().
                setUuid(UUID.newBuilder().setLeastSignificantBits(0L).setMostSignificantBits(1L).build()).build();
        AssetNamespace  nameMessage = AssetNamespace.newBuilder().
                setType(AssetMessageType.ActivateRequest).
                setData(messageData.toByteString()).build();
        TerraHarvestMessage request = 
                createMessageWithDestSource(m_LocalId, m_RemoteId, 0, Namespace.Asset, nameMessage);
        TerraHarvestPayload payload = TerraHarvestPayload.parseFrom(request.getTerraHarvestPayload());
        when(m_EncryptService.encryptMessage(Mockito.any(Builder.class), Mockito.any(TerraHarvestPayload.class))).
            thenReturn(request);
        when(m_EventChannel.getRemoteSystemId()).thenReturn(m_RemoteId);
        when(m_EventChannel.queueMessage(Mockito.any(TerraHarvestMessage.class))).thenReturn(true);
        final List<RemoteChannel> channelList = new ArrayList<RemoteChannel>();
        channelList.add(m_Channel);
        when(m_RemoteChannelLookup.getChannels(m_RemoteId)).thenReturn(channelList);
        m_SUT.queueMessage(m_EventChannel, payload, EncryptType.NONE, null);
        verify(m_Channel).queueMessage(request);
    }
@ Test public void testQueueMessageWithConvertToRemoteChannel ( ) throws IOException { activateSetUp ( ) ; ActivateRequestData messageData = ActivateRequestData . newBuilder ( ) . setUuid ( UUID . newBuilder ( ) . setLeastSignificantBits ( 0L ) . setMostSignificantBits ( 1L ) . build ( ) ) . build ( ) ; AssetNamespace nameMessage = AssetNamespace . newBuilder ( ) . setType ( AssetMessageType . ActivateRequest ) . setData ( messageData . toByteString ( ) ) . build ( ) ; TerraHarvestMessage request = createMessageWithDestSource ( m_LocalId , m_RemoteId , 0 , Namespace . Asset , nameMessage ) ; TerraHarvestPayload payload = TerraHarvestPayload . parseFrom ( request . getTerraHarvestPayload ( ) ) ; when ( m_EncryptService . encryptMessage ( Mockito . any ( Builder . class ) , Mockito . any ( TerraHarvestPayload . class ) ) ) . thenReturn ( request ) ; when ( m_EventChannel . getRemoteSystemId ( ) ) . thenReturn ( m_RemoteId ) ; when ( m_EventChannel . queueMessage ( Mockito . any ( TerraHarvestMessage . class ) ) ) . thenReturn ( true ) ; final List < RemoteChannel > channelList = new ArrayList < RemoteChannel > ( ) ; channelList . add ( m_Channel ) ; when ( m_RemoteChannelLookup . getChannels ( m_RemoteId ) ) . thenReturn ( channelList ) ; m_SUT . queueMessage ( m_EventChannel , payload , EncryptType . NONE , null ) ; verify ( m_Channel ) . queueMessage ( request ) ; }
Verify that the queue message method will check whether there is an available remote channel to the destination
 if an event channel is passed to the method.
Verify that the queue message method will check whether there is an available remote channel to the destination if an event channel is passed to the method .
//setup and activate component // construct data message to send, should reg handler