mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/messaging/TestMessageFactoryImpl.java
@Test
    public void testQueueEncryptionInfoMessageResponse() throws IOException
    {
        // construct fake request message
        TerraHarvestMessage request = createRequestFiller();
        
        GetEncryptionTypeResponseData dataMessage = 
                GetEncryptionTypeResponseData.newBuilder().setType(EncryptType.AES_ECDH_ECDSA).build();
        
        MessageResponseWrapper response = m_SUT.createEncryptionInfoResponseMessage(request, 
                EncryptionInfoMessageType.GetEncryptionTypeResponse, dataMessage);
        
        // request to send over mock channel and verify namespace
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.EncryptionInfo);
        
        // verify namespace message
        EncryptionInfoNamespace nameMessageResponse = EncryptionInfoNamespace.parseFrom(namespace);
        assertThat(nameMessageResponse.getType(), is(EncryptionInfoMessageType.GetEncryptionTypeResponse));

        //verify data message
        assertThat(nameMessageResponse.getData(), is(dataMessage.toByteString()));
        
        //--send again with no data message--//
        response = m_SUT.createEncryptionInfoResponseMessage(request, 
                EncryptionInfoMessageType.GetEncryptionTypeResponse, null);

        // request to send over mock channel and verify namespace
        namespace = confirmResponseWrapperQueue(response, Namespace.EncryptionInfo);

        // verify namespace message
        nameMessageResponse = 
                EncryptionInfoNamespace.parseFrom(namespace);
        assertThat(nameMessageResponse.getType(), is(EncryptionInfoMessageType.GetEncryptionTypeResponse));
        
        //verify data message is not set
        assertThat(nameMessageResponse.hasData(), is(false));
    }
/**
     * Verify the message wrapper returned contains the expected encryption information contents.
     */
Verify the message wrapper returned contains the expected encryption information contents.
Verify the message wrapper returned contains the expected encryption information contents .
@Test
    public void testQueueEncryptionInfoMessageResponse() throws IOException
    {
        TerraHarvestMessage request = createRequestFiller();
        GetEncryptionTypeResponseData dataMessage = 
                GetEncryptionTypeResponseData.newBuilder().setType(EncryptType.AES_ECDH_ECDSA).build();
        MessageResponseWrapper response = m_SUT.createEncryptionInfoResponseMessage(request, 
                EncryptionInfoMessageType.GetEncryptionTypeResponse, dataMessage);
        ByteString namespace = confirmResponseWrapperQueue(response, Namespace.EncryptionInfo);
        EncryptionInfoNamespace nameMessageResponse = EncryptionInfoNamespace.parseFrom(namespace);
        assertThat(nameMessageResponse.getType(), is(EncryptionInfoMessageType.GetEncryptionTypeResponse));
        assertThat(nameMessageResponse.getData(), is(dataMessage.toByteString()));
        response = m_SUT.createEncryptionInfoResponseMessage(request, 
                EncryptionInfoMessageType.GetEncryptionTypeResponse, null);
        namespace = confirmResponseWrapperQueue(response, Namespace.EncryptionInfo);
        nameMessageResponse = 
                EncryptionInfoNamespace.parseFrom(namespace);
        assertThat(nameMessageResponse.getType(), is(EncryptionInfoMessageType.GetEncryptionTypeResponse));
         is not set
        assertThat(nameMessageResponse.hasData(), is(false));
    }
@ Test public void testQueueEncryptionInfoMessageResponse ( ) throws IOException { TerraHarvestMessage request = createRequestFiller ( ) ; GetEncryptionTypeResponseData dataMessage = GetEncryptionTypeResponseData . newBuilder ( ) . setType ( EncryptType . AES_ECDH_ECDSA ) . build ( ) ; MessageResponseWrapper response = m_SUT . createEncryptionInfoResponseMessage ( request , EncryptionInfoMessageType . GetEncryptionTypeResponse , dataMessage ) ; ByteString namespace = confirmResponseWrapperQueue ( response , Namespace . EncryptionInfo ) ; EncryptionInfoNamespace nameMessageResponse = EncryptionInfoNamespace . parseFrom ( namespace ) ; assertThat ( nameMessageResponse . getType ( ) , is ( EncryptionInfoMessageType . GetEncryptionTypeResponse ) ) ; assertThat ( nameMessageResponse . getData ( ) , is ( dataMessage . toByteString ( ) ) ) ; response = m_SUT . createEncryptionInfoResponseMessage ( request , EncryptionInfoMessageType . GetEncryptionTypeResponse , null ) ; namespace = confirmResponseWrapperQueue ( response , Namespace . EncryptionInfo ) ; nameMessageResponse = EncryptionInfoNamespace . parseFrom ( namespace ) ; assertThat ( nameMessageResponse . getType ( ) , is ( EncryptionInfoMessageType . GetEncryptionTypeResponse ) ) ; assertThat ( nameMessageResponse . hasData ( ) , is ( false ) ) ; }
Verify the message wrapper returned contains the expected encryption information contents.
Verify the message wrapper returned contains the expected encryption information contents .
// construct fake request message // request to send over mock channel and verify namespace // verify namespace message //verify data message //--send again with no data message--// // request to send over mock channel and verify namespace // verify namespace message //verify data message is not set