@Test public void convertWithPossibleActions() throws Exception { CertificateInfo certificateInfo = new CertificateInfoBuilder().build(); KeyInfo keyInfo = new KeyInfoBuilder() .cert(certificateInfo) .build(); TokenInfo tokenInfo = new TokenInfoBuilder() .key(keyInfo) .build(); TokenCertificate certificate = tokenCertificateConverter.convert(certificateInfo, keyInfo, tokenInfo); Collection<PossibleAction> actions = certificate.getPossibleActions(); assertTrue(actions.contains(PossibleAction.ACTIVATE)); assertEquals(1, actions.size()); }
public TokenCertificate convert(CertificateInfo certificateInfo, KeyInfo keyInfo, TokenInfo tokenInfo) { TokenCertificate tokenCertificate = convert(certificateInfo); tokenCertificate.setPossibleActions(possibleActionConverter.convert( possibleActionsRuleEngine.getPossibleCertificateActions( tokenInfo, keyInfo, certificateInfo))); return tokenCertificate; }
TokenCertificateConverter { public TokenCertificate convert(CertificateInfo certificateInfo, KeyInfo keyInfo, TokenInfo tokenInfo) { TokenCertificate tokenCertificate = convert(certificateInfo); tokenCertificate.setPossibleActions(possibleActionConverter.convert( possibleActionsRuleEngine.getPossibleCertificateActions( tokenInfo, keyInfo, certificateInfo))); return tokenCertificate; } }
TokenCertificateConverter { public TokenCertificate convert(CertificateInfo certificateInfo, KeyInfo keyInfo, TokenInfo tokenInfo) { TokenCertificate tokenCertificate = convert(certificateInfo); tokenCertificate.setPossibleActions(possibleActionConverter.convert( possibleActionsRuleEngine.getPossibleCertificateActions( tokenInfo, keyInfo, certificateInfo))); return tokenCertificate; } @Autowired  TokenCertificateConverter(CertificateDetailsConverter certificateDetailsConverter,
            ClientConverter clientConverter,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            PossibleActionConverter possibleActionConverter); }
TokenCertificateConverter { public TokenCertificate convert(CertificateInfo certificateInfo, KeyInfo keyInfo, TokenInfo tokenInfo) { TokenCertificate tokenCertificate = convert(certificateInfo); tokenCertificate.setPossibleActions(possibleActionConverter.convert( possibleActionsRuleEngine.getPossibleCertificateActions( tokenInfo, keyInfo, certificateInfo))); return tokenCertificate; } @Autowired  TokenCertificateConverter(CertificateDetailsConverter certificateDetailsConverter,
            ClientConverter clientConverter,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            PossibleActionConverter possibleActionConverter); TokenCertificate convert(CertificateInfo certificateInfo,
            KeyInfo keyInfo,
            TokenInfo tokenInfo); TokenCertificate convert(CertificateInfo certificateInfo); List<TokenCertificate> convert(Iterable<CertificateInfo> certificateInfos); List<TokenCertificate> convert(Iterable<CertificateInfo> certificateInfos,
            KeyInfo keyInfo,
            TokenInfo tokenInfo); }
TokenCertificateConverter { public TokenCertificate convert(CertificateInfo certificateInfo, KeyInfo keyInfo, TokenInfo tokenInfo) { TokenCertificate tokenCertificate = convert(certificateInfo); tokenCertificate.setPossibleActions(possibleActionConverter.convert( possibleActionsRuleEngine.getPossibleCertificateActions( tokenInfo, keyInfo, certificateInfo))); return tokenCertificate; } @Autowired  TokenCertificateConverter(CertificateDetailsConverter certificateDetailsConverter,
            ClientConverter clientConverter,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            PossibleActionConverter possibleActionConverter); TokenCertificate convert(CertificateInfo certificateInfo,
            KeyInfo keyInfo,
            TokenInfo tokenInfo); TokenCertificate convert(CertificateInfo certificateInfo); List<TokenCertificate> convert(Iterable<CertificateInfo> certificateInfos); List<TokenCertificate> convert(Iterable<CertificateInfo> certificateInfos,
            KeyInfo keyInfo,
            TokenInfo tokenInfo);  }