EncryCredentialManagerImpl implements EncryCredentialManager { @Override public EncryCredentialInfo decrypt(EncryCredential encryCredential) { if(encryCredential!=null && !StringUtils.isEmpty(encryCredential.getCredential())){ String credential = encryCredential.getCredential(); return parseEncryCredential(credential); } return null; }  void setKeyService(KeyService keyService); @Override EncryCredentialInfo decrypt(EncryCredential encryCredential); @Override String encrypt(EncryCredentialInfo encryCredentialInfo); @Override boolean checkEncryCredentialInfo(
			EncryCredentialInfo encryCredentialInfo);  }
@Test public void testDecrypt() throws UnsupportedEncodingException { Assert.assertNull(this.encryCredentialManager.decrypt(null)); EncryCredential encryCredential = new EncryCredential(null); Assert.assertNull(this.encryCredentialManager.decrypt(encryCredential)); encryCredential = new EncryCredential(""); Assert.assertNull(this.encryCredentialManager.decrypt(encryCredential)); encryCredential = new EncryCredential("sdafdasfdsafdsa"); try{ this.encryCredentialManager.decrypt(encryCredential); Assert.fail("invalid encry credential ,should trhow an exception."); } catch (InvalidEncryCredentialException e) { } }