KettlePasswordService extends Base64PasswordService { @Override public String encrypt( String password ) throws PasswordServiceException { if ( StringUtil.isEmpty( password ) ) { return password; } else { return encoder.encode( password ); } } KettlePasswordService(); @Override String encrypt( String password ); @Override String decrypt( String encryptedPassword );  }
@Test public void testEncryptNullPassword( ) throws Exception { String res = service.encrypt( null ); assertNull( res ); }
@Test public void testEncryptWhiteSpacePassword( ) throws Exception{ String res = service.encrypt( " " ); assertEquals( "Encrypted 2be98afc86aa7f2e4cb79ce10bed2ef9a", res ); }
@Test public void testEncryptEmptyPassword( ) throws Exception{ String res = service.encrypt( "" ); assertEquals( "", res ); }