mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageSenderImpl.java
@Test
    public void testSendBaseMessageRemoteSystemEncryptionServiceException() throws IOException
    {
        // construct data message to send
        ControllerInfoData systemInfoData = ControllerInfoData.newBuilder().setName("blah").build();
        BaseNamespace baseNamespace = BaseNamespace.newBuilder().
                setType(BaseMessageType.ControllerInfo).
                setData(systemInfoData.toByteString()).build();
        
        TerraHarvestMessage request = 
                createMessageWithDestSource(m_LocalId, m_RemoteId, 0 , Namespace.Base, baseNamespace);
        
        TerraHarvestPayload payload = TerraHarvestPayload.parseFrom(request.getTerraHarvestPayload());
        
        try
        {
            m_SUT.setRemoteSystemEncryption(null);
            m_SUT.trySendMessage(m_RemoteId, payload);
            fail("Expected exception as the remote encryption service is not available.");
        }
        catch (IllegalStateException e)
        {
            //expected exception
        }
    }
/**
     * Verify that an exception is thrown in the event that no remote encryption service is set and the
     * send method without the encryption parameter is called.
     */
Verify that an exception is thrown in the event that no remote encryption service is set and the
send method without the encryption parameter is called.
Verify that an exception is thrown in the event that no remote encryption service is set and the send method without the encryption parameter is called .
@Test
    public void testSendBaseMessageRemoteSystemEncryptionServiceException() throws IOException
    {
        ControllerInfoData systemInfoData = ControllerInfoData.newBuilder().setName("blah").build();
        BaseNamespace baseNamespace = BaseNamespace.newBuilder().
                setType(BaseMessageType.ControllerInfo).
                setData(systemInfoData.toByteString()).build();
        TerraHarvestMessage request = 
                createMessageWithDestSource(m_LocalId, m_RemoteId, 0 , Namespace.Base, baseNamespace);
        TerraHarvestPayload payload = TerraHarvestPayload.parseFrom(request.getTerraHarvestPayload());
        try
        {
            m_SUT.setRemoteSystemEncryption(null);
            m_SUT.trySendMessage(m_RemoteId, payload);
            fail("Expected exception as the remote encryption service is not available.");
        }
        catch (IllegalStateException e)
        {
        }
    }
@ Test public void testSendBaseMessageRemoteSystemEncryptionServiceException ( ) throws IOException { ControllerInfoData systemInfoData = ControllerInfoData . newBuilder ( ) . setName ( "blah" ) . build ( ) ; BaseNamespace baseNamespace = BaseNamespace . newBuilder ( ) . setType ( BaseMessageType . ControllerInfo ) . setData ( systemInfoData . toByteString ( ) ) . build ( ) ; TerraHarvestMessage request = createMessageWithDestSource ( m_LocalId , m_RemoteId , 0 , Namespace . Base , baseNamespace ) ; TerraHarvestPayload payload = TerraHarvestPayload . parseFrom ( request . getTerraHarvestPayload ( ) ) ; try { m_SUT . setRemoteSystemEncryption ( null ) ; m_SUT . trySendMessage ( m_RemoteId , payload ) ; fail ( "Expected exception as the remote encryption service is not available." ) ; } catch ( IllegalStateException e ) { } }
Verify that an exception is thrown in the event that no remote encryption service is set and the
 send method without the encryption parameter is called.
Verify that an exception is thrown in the event that no remote encryption service is set and the send method without the encryption parameter is called .
// construct data message to send //expected exception