@Test public void convertMultipleCertificateAuthorityDiagnostics() { OcspResponderDiagnosticsStatus status1 = new OcspResponderDiagnosticsStatus(CA_NAME_1); DiagnosticsStatus diagnosticsStatus1 = new DiagnosticsStatus( DiagnosticsErrorCodes.ERROR_CODE_OCSP_RESPONSE_INVALID, PREVIOUS_UPDATE_1, NEXT_UPDATE_1); diagnosticsStatus1.setDescription(URL_1); status1.setOcspResponderStatusMap(Arrays.asList(diagnosticsStatus1)); OcspResponderDiagnosticsStatus status2 = new OcspResponderDiagnosticsStatus(CA_NAME_2); DiagnosticsStatus diagnosticsStatus2 = new DiagnosticsStatus( DiagnosticsErrorCodes.ERROR_CODE_OCSP_UNINITIALIZED, null, NEXT_UPDATE_2); diagnosticsStatus2.setDescription(URL_2); DiagnosticsStatus diagnosticsStatus3 = new DiagnosticsStatus( DiagnosticsErrorCodes.ERROR_CODE_OCSP_RESPONSE_INVALID, PREVIOUS_UPDATE_1, NEXT_UPDATE_1); diagnosticsStatus3.setDescription(URL_1); status2.setOcspResponderStatusMap(Arrays.asList(diagnosticsStatus2, diagnosticsStatus3)); List<OcspResponderDiagnostics> diagnostics = ocspResponderDiagnosticConverter.convert( Arrays.asList(status1, status2)); assertEquals(2, diagnostics.size()); assertEquals(1, diagnostics.get(0).getOcspResponders().size()); assertEquals(2, diagnostics.get(1).getOcspResponders().size()); assertEquals(CA_NAME_1, diagnostics.get(0).getDistinguishedName()); assertEquals(OcspStatus.ERROR_CODE_OCSP_RESPONSE_INVALID, diagnostics.get(0).getOcspResponders().get(0) .getStatusCode()); assertEquals(DiagnosticStatusClass.FAIL, diagnostics.get(0).getOcspResponders().get(0).getStatusClass()); assertEquals(PREVIOUS_UPDATE_1, diagnostics.get(0).getOcspResponders().get(0).getPrevUpdateAt()); assertEquals(NEXT_UPDATE_1, diagnostics.get(0).getOcspResponders().get(0).getNextUpdateAt()); assertEquals(URL_1, diagnostics.get(0).getOcspResponders().get(0).getUrl()); assertEquals(CA_NAME_2, diagnostics.get(1).getDistinguishedName()); assertEquals(OcspStatus.ERROR_CODE_OCSP_UNINITIALIZED, diagnostics.get(1).getOcspResponders().get(0) .getStatusCode()); assertEquals(DiagnosticStatusClass.WAITING, diagnostics.get(1).getOcspResponders().get(0).getStatusClass()); assertEquals(null, diagnostics.get(1).getOcspResponders().get(0).getPrevUpdateAt()); assertEquals(NEXT_UPDATE_2, diagnostics.get(1).getOcspResponders().get(0).getNextUpdateAt()); assertEquals(URL_2, diagnostics.get(1).getOcspResponders().get(0).getUrl()); assertEquals(OcspStatus.ERROR_CODE_OCSP_RESPONSE_INVALID, diagnostics.get(1).getOcspResponders() .get(1).getStatusCode()); assertEquals(DiagnosticStatusClass.FAIL, diagnostics.get(1).getOcspResponders().get(1).getStatusClass()); assertEquals(PREVIOUS_UPDATE_1, diagnostics.get(1).getOcspResponders().get(1).getPrevUpdateAt()); assertEquals(NEXT_UPDATE_1, diagnostics.get(1).getOcspResponders().get(1).getNextUpdateAt()); assertEquals(URL_1, diagnostics.get(1).getOcspResponders().get(1).getUrl()); }
public OcspResponderDiagnostics convert( OcspResponderDiagnosticsStatus ocspResponderDiagnosticsStatus) { OcspResponderDiagnostics ocspResponderDiagnostics = new OcspResponderDiagnostics(); ocspResponderDiagnostics.setDistinguishedName(ocspResponderDiagnosticsStatus.getName()); List<OcspResponder> ocspResponders = convertOcspResponders( ocspResponderDiagnosticsStatus.getOcspResponderStatusMap()); ocspResponderDiagnostics.setOcspResponders(ocspResponders); return ocspResponderDiagnostics; }
OcspResponderDiagnosticConverter { public OcspResponderDiagnostics convert( OcspResponderDiagnosticsStatus ocspResponderDiagnosticsStatus) { OcspResponderDiagnostics ocspResponderDiagnostics = new OcspResponderDiagnostics(); ocspResponderDiagnostics.setDistinguishedName(ocspResponderDiagnosticsStatus.getName()); List<OcspResponder> ocspResponders = convertOcspResponders( ocspResponderDiagnosticsStatus.getOcspResponderStatusMap()); ocspResponderDiagnostics.setOcspResponders(ocspResponders); return ocspResponderDiagnostics; } }
OcspResponderDiagnosticConverter { public OcspResponderDiagnostics convert( OcspResponderDiagnosticsStatus ocspResponderDiagnosticsStatus) { OcspResponderDiagnostics ocspResponderDiagnostics = new OcspResponderDiagnostics(); ocspResponderDiagnostics.setDistinguishedName(ocspResponderDiagnosticsStatus.getName()); List<OcspResponder> ocspResponders = convertOcspResponders( ocspResponderDiagnosticsStatus.getOcspResponderStatusMap()); ocspResponderDiagnostics.setOcspResponders(ocspResponders); return ocspResponderDiagnostics; }  }
OcspResponderDiagnosticConverter { public OcspResponderDiagnostics convert( OcspResponderDiagnosticsStatus ocspResponderDiagnosticsStatus) { OcspResponderDiagnostics ocspResponderDiagnostics = new OcspResponderDiagnostics(); ocspResponderDiagnostics.setDistinguishedName(ocspResponderDiagnosticsStatus.getName()); List<OcspResponder> ocspResponders = convertOcspResponders( ocspResponderDiagnosticsStatus.getOcspResponderStatusMap()); ocspResponderDiagnostics.setOcspResponders(ocspResponders); return ocspResponderDiagnostics; }  OcspResponderDiagnostics convert(
            OcspResponderDiagnosticsStatus ocspResponderDiagnosticsStatus); List<OcspResponderDiagnostics> convert(Iterable<OcspResponderDiagnosticsStatus> statuses); }
OcspResponderDiagnosticConverter { public OcspResponderDiagnostics convert( OcspResponderDiagnosticsStatus ocspResponderDiagnosticsStatus) { OcspResponderDiagnostics ocspResponderDiagnostics = new OcspResponderDiagnostics(); ocspResponderDiagnostics.setDistinguishedName(ocspResponderDiagnosticsStatus.getName()); List<OcspResponder> ocspResponders = convertOcspResponders( ocspResponderDiagnosticsStatus.getOcspResponderStatusMap()); ocspResponderDiagnostics.setOcspResponders(ocspResponders); return ocspResponderDiagnostics; }  OcspResponderDiagnostics convert(
            OcspResponderDiagnosticsStatus ocspResponderDiagnosticsStatus); List<OcspResponderDiagnostics> convert(Iterable<OcspResponderDiagnosticsStatus> statuses);  }