mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/namespace/TestEncryptionInfoNamespace.java
@Test
    public void testGetEncryptionTypeRequest() throws IOException, InvalidKeyException, NoSuchAlgorithmException, 
        NoSuchProviderException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, 
        InvalidAlgorithmParameterException, InterruptedException
    {
        //Create message
        final TerraHarvestMessage message = EncryptionUtil.createEncryptionInfoMessage(
                EncryptionInfoMessageType.GetEncryptionTypeRequest, null);
        
        //Send request
        message.writeDelimitedTo(m_Socket.getOutputStream());
        
        //wait for response
        final MessageListener listener = new MessageListener(m_Socket);
        
        //Verify response
        final EncryptionInfoNamespace namespace = (EncryptionInfoNamespace)listener.waitForMessage(
                Namespace.EncryptionInfo, EncryptionInfoMessageType.GetEncryptionTypeResponse, 500);
        
        final GetEncryptionTypeResponseData data = GetEncryptionTypeResponseData.parseFrom(namespace.getData());
        
        assertThat(data.getType(), is(EncryptType.NONE));
    }
/**
     * Verify that a valid encryption info response is sent when the controller receives an encryption info request.
     */
Verify that a valid encryption info response is sent when the controller receives an encryption info request.
Verify that a valid encryption info response is sent when the controller receives an encryption info request .
@Test
    public void testGetEncryptionTypeRequest() throws IOException, InvalidKeyException, NoSuchAlgorithmException, 
        NoSuchProviderException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, 
        InvalidAlgorithmParameterException, InterruptedException
    {
        final TerraHarvestMessage message = EncryptionUtil.createEncryptionInfoMessage(
                EncryptionInfoMessageType.GetEncryptionTypeRequest, null);
        message.writeDelimitedTo(m_Socket.getOutputStream());
        final MessageListener listener = new MessageListener(m_Socket);
        final EncryptionInfoNamespace namespace = (EncryptionInfoNamespace)listener.waitForMessage(
                Namespace.EncryptionInfo, EncryptionInfoMessageType.GetEncryptionTypeResponse, 500);
        final GetEncryptionTypeResponseData data = GetEncryptionTypeResponseData.parseFrom(namespace.getData());
        assertThat(data.getType(), is(EncryptType.NONE));
    }
@ Test public void testGetEncryptionTypeRequest ( ) throws IOException , InvalidKeyException , NoSuchAlgorithmException , NoSuchProviderException , NoSuchPaddingException , IllegalBlockSizeException , BadPaddingException , InvalidAlgorithmParameterException , InterruptedException { final TerraHarvestMessage message = EncryptionUtil . createEncryptionInfoMessage ( EncryptionInfoMessageType . GetEncryptionTypeRequest , null ) ; message . writeDelimitedTo ( m_Socket . getOutputStream ( ) ) ; final MessageListener listener = new MessageListener ( m_Socket ) ; final EncryptionInfoNamespace namespace = ( EncryptionInfoNamespace ) listener . waitForMessage ( Namespace . EncryptionInfo , EncryptionInfoMessageType . GetEncryptionTypeResponse , 500 ) ; final GetEncryptionTypeResponseData data = GetEncryptionTypeResponseData . parseFrom ( namespace . getData ( ) ) ; assertThat ( data . getType ( ) , is ( EncryptType . NONE ) ) ; }
Verify that a valid encryption info response is sent when the controller receives an encryption info request.
Verify that a valid encryption info response is sent when the controller receives an encryption info request .
//Create message //Send request //wait for response //Verify response