EncryCredentialManagerImpl implements EncryCredentialManager { @Override public boolean checkEncryCredentialInfo( EncryCredentialInfo encryCredentialInfo) { if(encryCredentialInfo!=null){ if(StringUtils.isEmpty(encryCredentialInfo.getUserId())){ return false; } Date now = getCurrentDate(); if(encryCredentialInfo.getExpiredTime()!=null){ long deta = encryCredentialInfo.getExpiredTime().getTime() - now.getTime(); if(deta>0){ return true; } } } return false; }  void setKeyService(KeyService keyService); @Override EncryCredentialInfo decrypt(EncryCredential encryCredential); @Override String encrypt(EncryCredentialInfo encryCredentialInfo); @Override boolean checkEncryCredentialInfo(
			EncryCredentialInfo encryCredentialInfo);  }
@Test public void testCheckEncryCredentialInfo() { Assert.assertFalse(this.encryCredentialManager.checkEncryCredentialInfo(null)); EncryCredentialInfo encryCredentialInfo = new EncryCredentialInfo(); Assert.assertFalse(this.encryCredentialManager.checkEncryCredentialInfo(encryCredentialInfo)); String userId = "test"; encryCredentialInfo = new EncryCredentialInfo(); encryCredentialInfo.setUserId(userId); Assert.assertFalse(this.encryCredentialManager.checkEncryCredentialInfo(encryCredentialInfo)); encryCredentialInfo.setExpiredTime(new Date()); Assert.assertFalse(this.encryCredentialManager.checkEncryCredentialInfo(encryCredentialInfo)); }