### Question:
Encr { public static final String decryptPassword( String encrypted ) { return encoder.decode( encrypted ); } Encr(); @Deprecated boolean init(); static void init( String encoderPluginId ); @Deprecated static final boolean checkSignatureShort( String signature, String verify ); @Deprecated static final String getSignatureShort( String signature ); static final String encryptPassword( String password ); static final String decryptPassword( String encrypted ); static final String encryptPasswordIfNotUsingVariables( String password ); static final String decryptPasswordOptionallyEncrypted( String password ); static void main( String[] args ); static final String PASSWORD_ENCRYPTED_PREFIX; }### Answer:
@Test public void testDecryptPassword() throws KettleValueException { String encryption; String decryption; encryption = Encr.encryptPassword( null ); decryption = Encr.decryptPassword( encryption ); assertTrue( "".equals( decryption ) ); encryption = Encr.encryptPassword( "" ); decryption = Encr.decryptPassword( encryption ); assertTrue( "".equals( decryption ) ); encryption = Encr.encryptPassword( " " ); decryption = Encr.decryptPassword( encryption ); assertTrue( " ".equals( decryption ) ); encryption = Encr.encryptPassword( "Test of different encryptions!!@#$%" ); decryption = Encr.decryptPassword( encryption ); assertTrue( "Test of different encryptions!!@#$%".equals( decryption ) ); encryption = Encr.encryptPassword( " Spaces left" ); decryption = Encr.decryptPassword( encryption ); assertTrue( " Spaces left".equals( decryption ) ); encryption = Encr.encryptPassword( "Spaces right" ); decryption = Encr.decryptPassword( encryption ); assertTrue( "Spaces right".equals( decryption ) ); encryption = Encr.encryptPassword( " Spaces " ); decryption = Encr.decryptPassword( encryption ); assertTrue( " Spaces ".equals( decryption ) ); encryption = Encr.encryptPassword( "1234567890" ); decryption = Encr.decryptPassword( encryption ); assertTrue( "1234567890".equals( decryption ) ); }
@Test public void testDecryptPassword() throws HopValueException { String encryption; String decryption; encryption = Encr.encryptPassword( null ); decryption = Encr.decryptPassword( encryption ); assertTrue( "".equals( decryption ) ); encryption = Encr.encryptPassword( "" ); decryption = Encr.decryptPassword( encryption ); assertTrue( "".equals( decryption ) ); encryption = Encr.encryptPassword( " " ); decryption = Encr.decryptPassword( encryption ); assertTrue( " ".equals( decryption ) ); encryption = Encr.encryptPassword( "Test of different encryptions!!@#$%" ); decryption = Encr.decryptPassword( encryption ); assertTrue( "Test of different encryptions!!@#$%".equals( decryption ) ); encryption = Encr.encryptPassword( " Spaces left" ); decryption = Encr.decryptPassword( encryption ); assertTrue( " Spaces left".equals( decryption ) ); encryption = Encr.encryptPassword( "Spaces right" ); decryption = Encr.decryptPassword( encryption ); assertTrue( "Spaces right".equals( decryption ) ); encryption = Encr.encryptPassword( " Spaces " ); decryption = Encr.decryptPassword( encryption ); assertTrue( " Spaces ".equals( decryption ) ); encryption = Encr.encryptPassword( "1234567890" ); decryption = Encr.decryptPassword( encryption ); assertTrue( "1234567890".equals( decryption ) ); }