diff --git a/src/test/java/io/stargate/sgv2/jsonapi/api/v1/DeleteCollectionIntegrationTest.java b/src/test/java/io/stargate/sgv2/jsonapi/api/v1/DeleteCollectionIntegrationTest.java index 2000fa1f23..337c971552 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/api/v1/DeleteCollectionIntegrationTest.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/api/v1/DeleteCollectionIntegrationTest.java @@ -84,6 +84,27 @@ public void notExisting() { .body("status.ok", is(1)); } + // [data-api#1186]: handling of non-existing keyspace + @Test + public void nonExistingKeyspace() { + givenHeadersAndJson( + """ + { + "deleteCollection": { + "name": "some-collection" + } + } + """) + .when() + .post(KeyspaceResource.BASE_PATH, "no_such_keyspace") + .then() + .statusCode(200) + .body("$", responseIsError()) + .body("errors", hasSize(1)) + .body("errors[0].errorCode", is("KEYSPACE_DOES_NOT_EXIST")) + .body("errors[0].message", containsString("no_such_keyspace")); + } + @Test public void invalidCommand() { givenHeadersAndJson( @@ -98,6 +119,7 @@ public void invalidCommand() { .then() .statusCode(200) .body("$", responseIsError()) + .body("errors", hasSize(1)) .body("errors[0].errorCode", is("COMMAND_FIELD_VALUE_INVALID")) .body( "errors[0].message",