From e94d0b77166e598673015ab9d87b291f6e0164e7 Mon Sep 17 00:00:00 2001 From: Ivan Senic Date: Fri, 7 Apr 2023 10:43:17 +0200 Subject: [PATCH] use collections instead of existingCollections --- .../java/io/stargate/sgv2/jsonapi/StargateJsonApi.java | 2 +- .../sgv2/jsonapi/api/model/command/CommandStatus.java | 2 +- .../jsonapi/api/v1/FindCollectionsIntegrationTest.java | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/stargate/sgv2/jsonapi/StargateJsonApi.java b/src/main/java/io/stargate/sgv2/jsonapi/StargateJsonApi.java index e0496f6bff..dd5cbfaffe 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/StargateJsonApi.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/StargateJsonApi.java @@ -579,7 +579,7 @@ """ { "status": { - "existingCollections": [ "events" ] + "collections": [ "events" ] } } """), diff --git a/src/main/java/io/stargate/sgv2/jsonapi/api/model/command/CommandStatus.java b/src/main/java/io/stargate/sgv2/jsonapi/api/model/command/CommandStatus.java index 3c784943aa..ed0f84b6a7 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/api/model/command/CommandStatus.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/api/model/command/CommandStatus.java @@ -11,7 +11,7 @@ public enum CommandStatus { @JsonProperty("deletedCount") DELETED_COUNT, /** Status for reporting existing namespaces. */ - @JsonProperty("existingCollections") + @JsonProperty("collections") EXISTING_COLLECTIONS, /** The element has the list of inserted ids */ @JsonProperty("insertedIds") diff --git a/src/test/java/io/stargate/sgv2/jsonapi/api/v1/FindCollectionsIntegrationTest.java b/src/test/java/io/stargate/sgv2/jsonapi/api/v1/FindCollectionsIntegrationTest.java index e601f19f91..fc2b5c99a4 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/api/v1/FindCollectionsIntegrationTest.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/api/v1/FindCollectionsIntegrationTest.java @@ -71,8 +71,8 @@ public void happyPath() { .post(NamespaceResource.BASE_PATH, keyspaceId.asInternal()) .then() .statusCode(200) - .body("status.existingCollections", hasSize(1)) - .body("status.existingCollections", hasItem(collection)); + .body("status.collections", hasSize(1)) + .body("status.collections", hasItem(collection)); } @Test @@ -116,7 +116,7 @@ public void emptyNamespace() { .post(NamespaceResource.BASE_PATH, namespace) .then() .statusCode(200) - .body("status.existingCollections", hasSize(0)); + .body("status.collections", hasSize(0)); // cleanup json = @@ -159,7 +159,7 @@ public void systemKeyspace() { .post(NamespaceResource.BASE_PATH, "system") .then() .statusCode(200) - .body("status.existingCollections", hasSize(0)); + .body("status.collections", hasSize(0)); } @Test