Base64PasswordService implements IPasswordService { public String encrypt( String password ) throws PasswordServiceException { return StringUtil.isEmpty( password ) ? password : new String( Base64.encodeBase64( password.getBytes() ) ); }  String encrypt( String password ); String decrypt( String encryptedPassword );  }
@Test public void testEncryptNullPassword( ) throws Exception { res = service.encrypt( null ); assertNull( res ); }
@Test public void testEncryptWhiteSpacePassword( ) throws Exception{ res = service.encrypt( " " ); assertEquals( res, "ICAg" ); }
@Test public void testEncryptEmptyPassword( ) throws Exception{ res = service.encrypt( "" ); assertEquals( res, "" ); }