RetrieveConnectionLogsResponse extends AbstractCommandResponse<RetrieveConnectionLogsResponse> implements ConnectivityQueryCommandResponse<RetrieveConnectionLogsResponse> { public static RetrieveConnectionLogsResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders) { return fromJson(JsonFactory.newObject(jsonString), dittoHeaders); } private  RetrieveConnectionLogsResponse(final ConnectionId connectionId, final Collection<LogEntry> connectionLogs,
            @Nullable final Instant enabledSince, @Nullable final Instant enabledUntil,
            final DittoHeaders dittoHeaders); static RetrieveConnectionLogsResponse of(final ConnectionId connectionId,
            final Collection<LogEntry> connectionLogs, @Nullable final Instant enabledSince,
            @Nullable final Instant enabledUntil, final DittoHeaders dittoHeaders); static RetrieveConnectionLogsResponse mergeRetrieveConnectionLogsResponse(
            final RetrieveConnectionLogsResponse first,
            final RetrieveConnectionLogsResponse second); static RetrieveConnectionLogsResponse fromJson(final String jsonString,
            final DittoHeaders dittoHeaders); static RetrieveConnectionLogsResponse fromJson(final JsonObject jsonObject,
            final DittoHeaders dittoHeaders); Collection<LogEntry> getConnectionLogs(); Optional<Instant> getEnabledSince(); Optional<Instant> getEnabledUntil(); @Override ConnectionId getConnectionEntityId(); @Override JsonValue getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override RetrieveConnectionLogsResponse setEntity(final JsonValue entity); @Override RetrieveConnectionLogsResponse setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString(); static final String TYPE; }
@Test public void fromJsonWithIllegalDate() { final JsonObject json = KNOWN_JSON.toBuilder() .set(RetrieveConnectionLogsResponse.JsonFields.ENABLED_SINCE, "not-a-date") .build(); assertThatExceptionOfType(JsonParseException.class) .isThrownBy( () -> RetrieveConnectionLogsResponse.fromJson(json, EMPTY_HEADERS)) .withMessage("The JSON object's field <%s> is not in ISO-8601 format as expected!", RetrieveConnectionLogsResponse.JsonFields.ENABLED_SINCE.getPointer()); }