### Question:
TokenCertificateConverter { public TokenCertificate convert(CertificateInfo certificateInfo) { TokenCertificate tokenCertificate = new TokenCertificate(); tokenCertificate.setActive(certificateInfo.isActive()); tokenCertificate.setCertificateDetails(certificateDetailsConverter.convert(certificateInfo)); if (certificateInfo.getMemberId() != null) { tokenCertificate.setOwnerId(clientConverter.convertId(certificateInfo.getMemberId())); } tokenCertificate.setOcspStatus(getOcspStatus(certificateInfo, tokenCertificate.getCertificateDetails())); tokenCertificate.setSavedToConfiguration(certificateInfo.isSavedToConfiguration()); tokenCertificate.setStatus(CertificateStatusMapping.map(certificateInfo.getStatus()) .orElse(null)); return tokenCertificate; } @Autowired  TokenCertificateConverter(CertificateDetailsConverter certificateDetailsConverter,
            ClientConverter clientConverter); TokenCertificate convert(CertificateInfo certificateInfo); List<TokenCertificate> convert(Iterable<CertificateInfo> certificateInfos);  }### Answer:
@Test public void convert() throws Exception { X509Certificate cert = CertificateTestUtils.getMockCertificate(); CertificateInfo certificateInfo = createTestCertificateInfo(cert, CertificateStatus.GOOD, CertificateInfo.STATUS_REGISTERED); TokenCertificate certificate = tokenCertificateConverter.convert(certificateInfo); assertEquals(true, certificate.getActive()); assertEquals("N/A", certificate.getCertificateDetails().getSubjectCommonName()); assertEquals(2038, certificate.getCertificateDetails().getNotAfter().getYear()); assertEquals(CertificateOcspStatus.OCSP_RESPONSE_GOOD, certificate.getOcspStatus()); assertEquals("a:b:c", certificate.getOwnerId()); assertEquals(true, certificate.getSavedToConfiguration()); assertEquals(org.niis.xroad.restapi.openapi.model.CertificateStatus.REGISTERED, certificate.getStatus()); }