### Question:
TokenCertificateSigningRequestConverter { public TokenCertificateSigningRequest convert(CertRequestInfo csrInfo, KeyInfo keyInfo, TokenInfo tokenInfo) { TokenCertificateSigningRequest request = convert(csrInfo); request.setPossibleActions(possibleActionConverter.convert( possibleActionsRuleEngine.getPossibleCsrActions( tokenInfo))); return request; } @Autowired  TokenCertificateSigningRequestConverter(ClientConverter clientConverter,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            PossibleActionConverter possibleActionConverter); TokenCertificateSigningRequest convert(CertRequestInfo csrInfo,
            KeyInfo keyInfo,
            TokenInfo tokenInfo); TokenCertificateSigningRequest convert(CertRequestInfo csrInfo); List<TokenCertificateSigningRequest> convert(Iterable<CertRequestInfo> csrInfos); List<TokenCertificateSigningRequest> convert(Iterable<CertRequestInfo> csrInfos,
            KeyInfo keyInfo,
            TokenInfo tokenInfo);  }### Answer:
@Test public void convert() { CertRequestInfo certRequestInfo = new CertRequestInfo("id", ClientId.create("a", "b", "c"), "subject-name"); TokenCertificateSigningRequest csr = csrConverter.convert(certRequestInfo); assertEquals("id", csr.getId()); assertEquals("a:b:c", csr.getOwnerId()); }
@Test public void convertWithPossibleActions() throws Exception { CertRequestInfo certRequestInfo = new CertRequestInfoBuilder().build(); KeyInfo keyInfo = new KeyInfoBuilder() .csr(certRequestInfo) .build(); TokenInfo tokenInfo = new TokenInfoBuilder() .key(keyInfo) .build(); TokenCertificateSigningRequest csr = csrConverter.convert(certRequestInfo, keyInfo, tokenInfo); Collection<PossibleAction> actions = csr.getPossibleActions(); assertTrue(actions.contains(PossibleAction.DELETE)); assertEquals(1, actions.size()); }