mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageSenderImpl.java
@Test
    public void testQueueMessageWithEventChannel() 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);
        when(m_RemoteChannelLookup.getChannels(m_RemoteId)).thenReturn(new ArrayList<RemoteChannel>());
        m_SUT.queueMessage(m_EventChannel, payload, EncryptType.NONE, null);
        
        verify(m_EventChannel).queueMessage(request);
    }
/**
     * Verify that the event channel queue message method is called.
     */
Verify that the event channel queue message method is called.
Verify that the event channel queue message method is called .
@Test
    public void testQueueMessageWithEventChannel() 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);
        when(m_RemoteChannelLookup.getChannels(m_RemoteId)).thenReturn(new ArrayList<RemoteChannel>());
        m_SUT.queueMessage(m_EventChannel, payload, EncryptType.NONE, null);
        verify(m_EventChannel).queueMessage(request);
    }
@ Test public void testQueueMessageWithEventChannel ( ) 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 ) ; when ( m_RemoteChannelLookup . getChannels ( m_RemoteId ) ) . thenReturn ( new ArrayList < RemoteChannel > ( ) ) ; m_SUT . queueMessage ( m_EventChannel , payload , EncryptType . NONE , null ) ; verify ( m_EventChannel ) . queueMessage ( request ) ; }
Verify that the event channel queue message method is called.
Verify that the event channel queue message method is called .
//setup and activate component // construct data message to send, should reg handler