private SearchErrorResponse(final DittoRuntimeException dittoRuntimeException, final DittoHeaders dittoHeaders) { super(TYPE, dittoRuntimeException.getStatusCode(), dittoHeaders); this.dittoRuntimeException = requireNonNull(dittoRuntimeException, "The DittoRuntimeException must not be null"); }
private SearchErrorResponse(final DittoRuntimeException dittoRuntimeException, final DittoHeaders dittoHeaders) { super(TYPE, dittoRuntimeException.getStatusCode(), dittoHeaders); this.dittoRuntimeException = requireNonNull(dittoRuntimeException, "The DittoRuntimeException must not be null"); }
private ConnectivityErrorResponse(final DittoRuntimeException dittoRuntimeException, final DittoHeaders dittoHeaders) { super(TYPE, dittoRuntimeException.getStatusCode(), dittoHeaders); this.dittoRuntimeException = requireNonNull(dittoRuntimeException, "The CR Runtime Exception must not be null"); }
private ConnectivityErrorResponse(final DittoRuntimeException dittoRuntimeException, final DittoHeaders dittoHeaders) { super(TYPE, dittoRuntimeException.getStatusCode(), dittoHeaders); this.dittoRuntimeException = requireNonNull(dittoRuntimeException, "The CR Runtime Exception must not be null"); }
private ThingErrorResponse(final String thingId, final DittoRuntimeException dittoRuntimeException, final DittoHeaders dittoHeaders) { super(TYPE, dittoRuntimeException.getStatusCode(), dittoHeaders); this.thingId = requireNonNull(thingId, "Thing ID"); this.dittoRuntimeException = requireNonNull(dittoRuntimeException, "The Ditto Runtime Exception must not be null"); }
private PolicyErrorResponse(final String policyId, final DittoRuntimeException dittoRuntimeException, final DittoHeaders dittoHeaders) { super(TYPE, dittoRuntimeException.getStatusCode(), dittoHeaders); this.policyId = requireNonNull(policyId, "Policy ID"); this.dittoRuntimeException = requireNonNull(dittoRuntimeException, "The Ditto Runtime Exception must not be null"); }
private ThingErrorResponse(final String thingId, final DittoRuntimeException dittoRuntimeException, final DittoHeaders dittoHeaders) { super(TYPE, dittoRuntimeException.getStatusCode(), dittoHeaders); this.thingId = requireNonNull(thingId, "Thing ID"); this.dittoRuntimeException = requireNonNull(dittoRuntimeException, "The Ditto Runtime Exception must not be null"); }
private PolicyErrorResponse(final String policyId, final DittoRuntimeException dittoRuntimeException, final DittoHeaders dittoHeaders) { super(TYPE, dittoRuntimeException.getStatusCode(), dittoHeaders); this.policyId = requireNonNull(policyId, "Policy ID"); this.dittoRuntimeException = requireNonNull(dittoRuntimeException, "The Ditto Runtime Exception must not be null"); }
private HttpResponse buildResponseWithoutHeadersFromDittoRuntimeException(final DittoRuntimeException dre) { final HttpResponse responseWithoutHeaders = HttpResponse.create().withStatus(dre.getStatusCode().toInt()); if (HttpStatusCode.NOT_MODIFIED.equals(dre.getStatusCode())) { return responseWithoutHeaders; } else { return responseWithoutHeaders.withEntity(CONTENT_TYPE_JSON, ByteString.fromString(dre.toJsonString())); } }
public DittoRuntimeAssert hasStatusCode(final HttpStatusCode expectedStatusCode) { isNotNull(); final HttpStatusCode actualStatusCode = actual.getStatusCode(); assertThat(actualStatusCode) // .overridingErrorMessage("Expected status code of DittoRuntimeException to be \n<%s> but it was \n<%s>", expectedStatusCode, actualStatusCode) // .isEqualTo(expectedStatusCode); return this; }
/** * Checks if this DittoRuntimeException has the expected HTTP status code. * * @param expectedValue the expected HTTP status code. * @return this Assert instance to allow Method chaining. */ public DittoRuntimeAssert hasStatusCodeValue(final int expectedValue) { isNotNull(); final HttpStatusCode actualStatusCode = actual.getStatusCode(); final int actualStatusCodeValue = actualStatusCode.toInt(); assertThat(actualStatusCodeValue) .overridingErrorMessage("Expected status code value of DittoRuntimeException to be\n<%s> but it " + "was\n<%s>", expectedValue, actualStatusCodeValue) .isEqualTo(expectedValue); return myself; }
LOGGER.info("DittoRuntimeException in gateway RootRoute: {}", cre.getMessage()) ); return complete(HttpResponse.create().withStatus(cre.getStatusCode().toInt()) .withEntity(ContentTypes.APPLICATION_JSON, ByteString.fromString(cre.toJsonString()))); })
final int statusCode = cre.getStatusCode().toInt();