Skip to content

Commit

Permalink
Remove ITs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazel-Datastax committed Jan 4, 2025
1 parent 8f41a41 commit 34df7f5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,64 +116,6 @@ public void unknownCommandField() {
containsString("(\"filter\", \"options\", \"projection\", \"sort\")"));
}

@Test
public void invalidKeyspaceName() {
String json =
"""
{
"insertOne": {
"document": {}
}
}
""";

given()
.headers(getHeaders())
.contentType(ContentType.JSON)
.body(json)
.when()
.post(CollectionResource.BASE_PATH, "7_no_leading_number", collectionName)
.then()
.statusCode(200)
.body("$", responseIsError())
.body("errors", hasSize(1))
.body("errors[0].exceptionClass", is("JsonApiException"))
.body("errors[0].errorCode", is("COMMAND_FIELD_INVALID"))
.body(
"errors[0].message",
startsWith(
"Request invalid: field 'keyspace' value \"7_no_leading_number\" not valid. Problem: must match "));
}

@Test
public void invalidCollectionName() {
String json =
"""
{
"insertOne": {
"document": {}
}
}
""";

given()
.headers(getHeaders())
.contentType(ContentType.JSON)
.body(json)
.when()
.post(CollectionResource.BASE_PATH, keyspaceName, "7_no_leading_number")
.then()
.statusCode(200)
.body("$", responseIsError())
.body("errors", hasSize(1))
.body("errors[0].exceptionClass", is("JsonApiException"))
.body("errors[0].errorCode", is("COMMAND_FIELD_INVALID"))
.body(
"errors[0].message",
startsWith(
"Request invalid: field 'collection' value \"7_no_leading_number\" not valid. Problem: must match "));
}

@Test
public void emptyBody() {
given()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void invalidCommand() {
.body(
"errors[0].message",
is(
"Request invalid: field 'command.name' value `null` not valid. Problem: must not be null."));
"Request invalid: field 'command.name' value `null` not valid. Problem: must not be empty."));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -945,26 +945,6 @@ public void failForMissingCollection() {
is("Collection does not exist, collection name: no_such_collection"));
}

@Test
public void failForInvalidCollectionName() {
given()
.headers(getHeaders())
.contentType(ContentType.JSON)
.body("{ \"findOne\": { \"filter\" : {\"_id\": \"doc1\"}}}")
.when()
.post(CollectionResource.BASE_PATH, keyspaceName, "table,rate=100")
.then()
.statusCode(200)
.body("$", responseIsError())
.body("errors", hasSize(1))
.body("errors[0].errorCode", is("COMMAND_FIELD_INVALID"))
.body("errors[0].exceptionClass", is("JsonApiException"))
.body(
"errors[0].message",
startsWith(
"Request invalid: field 'collection' value \"table,rate=100\" not valid. Problem:"));
}

@Test
public void failForInvalidJsonExtension() {
given()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,34 +75,6 @@ public void unknownCommand() {
"Provided command unknown: \"unknownCommand\" not one of \"KeyspaceCommand\"s: known commands are [createCollection"));
}

@Test
public void invalidNamespaceName() {
String json =
"""
{
"createCollection": {
"name": "ignore_me"
}
}
""";

given()
.headers(getHeaders())
.contentType(ContentType.JSON)
.body(json)
.when()
.post(KeyspaceResource.BASE_PATH, "7_no_leading_number")
.then()
.statusCode(200)
.body("$", responseIsError())
.body("errors[0].errorCode", is("COMMAND_FIELD_INVALID"))
.body("errors[0].exceptionClass", is("JsonApiException"))
.body(
"errors[0].message",
startsWith(
"Request invalid: field 'keyspace' value \"7_no_leading_number\" not valid. Problem: must match "));
}

@Test
public void emptyBody() {
given()
Expand Down

0 comments on commit 34df7f5

Please sign in to comment.