@Test public void convertSingleTimestampingServiceDiagnostics() { final OffsetDateTime now = OffsetDateTime.now(); DiagnosticsStatus diagnosticsStatus = new DiagnosticsStatus(DiagnosticsErrorCodes.RETURN_SUCCESS, now); diagnosticsStatus.setDescription(URL_1); TimestampingServiceDiagnostics timestampingServiceDiagnostics = timestampingServiceDiagnosticConverter.convert( diagnosticsStatus ); assertEquals(TimestampingStatus.SUCCESS, timestampingServiceDiagnostics.getStatusCode()); assertEquals(DiagnosticStatusClass.OK, timestampingServiceDiagnostics.getStatusClass()); assertEquals(now, timestampingServiceDiagnostics.getPrevUpdateAt()); }
public TimestampingServiceDiagnostics convert(DiagnosticsStatus diagnosticsStatus) { TimestampingServiceDiagnostics timestampingServiceDiagnostics = new TimestampingServiceDiagnostics(); timestampingServiceDiagnostics.setUrl(diagnosticsStatus.getDescription()); Optional<TimestampingStatus> statusCode = TimestampingStatusMapping.map( diagnosticsStatus.getReturnCode()); timestampingServiceDiagnostics.setStatusCode(statusCode.orElse(null)); Optional<DiagnosticStatusClass> statusClass = DiagnosticStatusClassMapping.map( diagnosticsStatus.getReturnCode()); timestampingServiceDiagnostics.setStatusClass(statusClass.orElse(null)); if (diagnosticsStatus.getPrevUpdate() != null) { timestampingServiceDiagnostics.setPrevUpdateAt(diagnosticsStatus.getPrevUpdate()); } return timestampingServiceDiagnostics; }
TimestampingServiceDiagnosticConverter { public TimestampingServiceDiagnostics convert(DiagnosticsStatus diagnosticsStatus) { TimestampingServiceDiagnostics timestampingServiceDiagnostics = new TimestampingServiceDiagnostics(); timestampingServiceDiagnostics.setUrl(diagnosticsStatus.getDescription()); Optional<TimestampingStatus> statusCode = TimestampingStatusMapping.map( diagnosticsStatus.getReturnCode()); timestampingServiceDiagnostics.setStatusCode(statusCode.orElse(null)); Optional<DiagnosticStatusClass> statusClass = DiagnosticStatusClassMapping.map( diagnosticsStatus.getReturnCode()); timestampingServiceDiagnostics.setStatusClass(statusClass.orElse(null)); if (diagnosticsStatus.getPrevUpdate() != null) { timestampingServiceDiagnostics.setPrevUpdateAt(diagnosticsStatus.getPrevUpdate()); } return timestampingServiceDiagnostics; } }
TimestampingServiceDiagnosticConverter { public TimestampingServiceDiagnostics convert(DiagnosticsStatus diagnosticsStatus) { TimestampingServiceDiagnostics timestampingServiceDiagnostics = new TimestampingServiceDiagnostics(); timestampingServiceDiagnostics.setUrl(diagnosticsStatus.getDescription()); Optional<TimestampingStatus> statusCode = TimestampingStatusMapping.map( diagnosticsStatus.getReturnCode()); timestampingServiceDiagnostics.setStatusCode(statusCode.orElse(null)); Optional<DiagnosticStatusClass> statusClass = DiagnosticStatusClassMapping.map( diagnosticsStatus.getReturnCode()); timestampingServiceDiagnostics.setStatusClass(statusClass.orElse(null)); if (diagnosticsStatus.getPrevUpdate() != null) { timestampingServiceDiagnostics.setPrevUpdateAt(diagnosticsStatus.getPrevUpdate()); } return timestampingServiceDiagnostics; }  }
TimestampingServiceDiagnosticConverter { public TimestampingServiceDiagnostics convert(DiagnosticsStatus diagnosticsStatus) { TimestampingServiceDiagnostics timestampingServiceDiagnostics = new TimestampingServiceDiagnostics(); timestampingServiceDiagnostics.setUrl(diagnosticsStatus.getDescription()); Optional<TimestampingStatus> statusCode = TimestampingStatusMapping.map( diagnosticsStatus.getReturnCode()); timestampingServiceDiagnostics.setStatusCode(statusCode.orElse(null)); Optional<DiagnosticStatusClass> statusClass = DiagnosticStatusClassMapping.map( diagnosticsStatus.getReturnCode()); timestampingServiceDiagnostics.setStatusClass(statusClass.orElse(null)); if (diagnosticsStatus.getPrevUpdate() != null) { timestampingServiceDiagnostics.setPrevUpdateAt(diagnosticsStatus.getPrevUpdate()); } return timestampingServiceDiagnostics; }  TimestampingServiceDiagnostics convert(DiagnosticsStatus diagnosticsStatus); List<TimestampingServiceDiagnostics> convert(Iterable<DiagnosticsStatus> statuses); }
TimestampingServiceDiagnosticConverter { public TimestampingServiceDiagnostics convert(DiagnosticsStatus diagnosticsStatus) { TimestampingServiceDiagnostics timestampingServiceDiagnostics = new TimestampingServiceDiagnostics(); timestampingServiceDiagnostics.setUrl(diagnosticsStatus.getDescription()); Optional<TimestampingStatus> statusCode = TimestampingStatusMapping.map( diagnosticsStatus.getReturnCode()); timestampingServiceDiagnostics.setStatusCode(statusCode.orElse(null)); Optional<DiagnosticStatusClass> statusClass = DiagnosticStatusClassMapping.map( diagnosticsStatus.getReturnCode()); timestampingServiceDiagnostics.setStatusClass(statusClass.orElse(null)); if (diagnosticsStatus.getPrevUpdate() != null) { timestampingServiceDiagnostics.setPrevUpdateAt(diagnosticsStatus.getPrevUpdate()); } return timestampingServiceDiagnostics; }  TimestampingServiceDiagnostics convert(DiagnosticsStatus diagnosticsStatus); List<TimestampingServiceDiagnostics> convert(Iterable<DiagnosticsStatus> statuses);  }