Skip to content

Commit

Permalink
added test in all int tests, new round of refactoring of int tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Senic committed Mar 30, 2023
1 parent 0202362 commit 226475f
Show file tree
Hide file tree
Showing 9 changed files with 573 additions and 407 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ private void insert(String json) {
}

@Test
@Order(2)
public void countNoFilter() {
public void noFilter() {
String json =
"""
{
Expand All @@ -139,8 +138,30 @@ public void countNoFilter() {
}

@Test
@Order(2)
public void countByColumn() {
public void emptyOptionsAllowed() {
String json =
"""
{
"countDocuments": {
"options": {}
}
}
""";

given()
.header(HttpConstants.AUTHENTICATION_TOKEN_HEADER_NAME, getAuthToken())
.contentType(ContentType.JSON)
.body(json)
.when()
.post(CollectionResource.BASE_PATH, keyspaceId.asInternal(), collectionName)
.then()
.statusCode(200)
.body("status.count", is(5))
.body("errors", is(nullValue()));
}

@Test
public void byColumn() {
String json =
"""
{
Expand All @@ -164,8 +185,7 @@ public void countByColumn() {
}

@Test
@Order(2)
public void countWithEqComparisonOperator() {
public void withEqComparisonOperator() {
String json =
"""
{
Expand All @@ -189,8 +209,7 @@ public void countWithEqComparisonOperator() {
}

@Test
@Order(2)
public void countWithEqSubDoc() {
public void withEqSubDoc() {
String json =
"""
{
Expand All @@ -214,8 +233,7 @@ public void countWithEqSubDoc() {
}

@Test
@Order(2)
public void countWithEqSubDocWithIndex() {
public void withEqSubDocWithIndex() {
String json =
"""
{
Expand All @@ -239,8 +257,7 @@ public void countWithEqSubDocWithIndex() {
}

@Test
@Order(2)
public void countWithEqArrayElement() {
public void withEqArrayElement() {
String json =
"""
{
Expand All @@ -264,8 +281,7 @@ public void countWithEqArrayElement() {
}

@Test
@Order(2)
public void countWithExistFalseOperator() {
public void withExistFalseOperator() {
String json =
"""
{
Expand All @@ -287,8 +303,7 @@ public void countWithExistFalseOperator() {
}

@Test
@Order(2)
public void countWithExistOperator() {
public void withExistOperator() {
String json =
"""
{
Expand All @@ -312,8 +327,7 @@ public void countWithExistOperator() {
}

@Test
@Order(2)
public void countWithAllOperator() {
public void withAllOperator() {
String json =
"""
{
Expand All @@ -337,8 +351,7 @@ public void countWithAllOperator() {
}

@Test
@Order(2)
public void countWithAllOperatorLongerString() {
public void withAllOperatorLongerString() {
String json =
"""
{
Expand All @@ -362,8 +375,7 @@ public void countWithAllOperatorLongerString() {
}

@Test
@Order(2)
public void countWithAllOperatorMixedAFormatArray() {
public void withAllOperatorMixedAFormatArray() {
String json =
"""
{
Expand All @@ -387,8 +399,7 @@ public void countWithAllOperatorMixedAFormatArray() {
}

@Test
@Order(2)
public void countWithAllOperatorNoMatch() {
public void withAllOperatorNoMatch() {
String json =
"""
{
Expand All @@ -412,8 +423,7 @@ public void countWithAllOperatorNoMatch() {
}

@Test
@Order(2)
public void countWithEqSubDocumentShortcut() {
public void withEqSubDocumentShortcut() {
String json =
"""
{
Expand All @@ -437,8 +447,7 @@ public void countWithEqSubDocumentShortcut() {
}

@Test
@Order(2)
public void countWithEqSubDocument() {
public void withEqSubDocument() {
String json =
"""
{
Expand All @@ -462,8 +471,7 @@ public void countWithEqSubDocument() {
}

@Test
@Order(2)
public void countWithEqSubDocumentOrderChangeNoMatch() {
public void withEqSubDocumentOrderChangeNoMatch() {
String json =
"""
{
Expand All @@ -487,8 +495,7 @@ public void countWithEqSubDocumentOrderChangeNoMatch() {
}

@Test
@Order(2)
public void countWithEqSubDocumentNoMatch() {
public void withEqSubDocumentNoMatch() {
String json =
"""
{
Expand All @@ -512,8 +519,7 @@ public void countWithEqSubDocumentNoMatch() {
}

@Test
@Order(2)
public void countWithSizeOperator() {
public void withSizeOperator() {
String json =
"""
{
Expand All @@ -537,8 +543,7 @@ public void countWithSizeOperator() {
}

@Test
@Order(2)
public void countWithSizeOperatorNoMatch() {
public void withSizeOperatorNoMatch() {
String json =
"""
{
Expand All @@ -562,8 +567,7 @@ public void countWithSizeOperatorNoMatch() {
}

@Test
@Order(2)
public void countWithEqOperatorArray() {
public void withEqOperatorArray() {
String json =
"""
{
Expand All @@ -587,8 +591,7 @@ public void countWithEqOperatorArray() {
}

@Test
@Order(2)
public void countWithEqOperatorNestedArray() {
public void withEqOperatorNestedArray() {
String json =
"""
{
Expand All @@ -612,8 +615,7 @@ public void countWithEqOperatorNestedArray() {
}

@Test
@Order(2)
public void countWithEqOperatorArrayNoMatch() {
public void withEqOperatorArrayNoMatch() {
String json =
"""
{
Expand All @@ -637,8 +639,7 @@ public void countWithEqOperatorArrayNoMatch() {
}

@Test
@Order(2)
public void countWithEqOperatorNestedArrayNoMatch() {
public void withEqOperatorNestedArrayNoMatch() {
String json =
"""
{
Expand All @@ -662,8 +663,7 @@ public void countWithEqOperatorNestedArrayNoMatch() {
}

@Test
@Order(2)
public void countWithNEComparisonOperator() {
public void withNEComparisonOperator() {
String json =
"""
{
Expand All @@ -685,8 +685,7 @@ public void countWithNEComparisonOperator() {
}

@Test
@Order(2)
public void countByBooleanColumn() {
public void byBooleanColumn() {
String json =
"""
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void insert(int countOfDocument) {
}

@Test
public void deleteManyById() {
public void byId() {
insert(2);
String json =
"""
Expand Down Expand Up @@ -129,7 +129,34 @@ public void deleteManyById() {
}

@Test
public void deleteManyByColumn() {
public void emptyOptionsAllowed() {
insert(2);
String json =
"""
{
"deleteMany": {
"filter" : {"_id" : "doc1"},
"options": {}
}
}
""";

given()
.header(HttpConstants.AUTHENTICATION_TOKEN_HEADER_NAME, getAuthToken())
.contentType(ContentType.JSON)
.body(json)
.when()
.post(CollectionResource.BASE_PATH, keyspaceId.asInternal(), collectionName)
.then()
.statusCode(200)
.body("status.deletedCount", is(1))
.body("status.moreData", is(nullValue()))
.body("data", is(nullValue()))
.body("errors", is(nullValue()));
}

@Test
public void byColumn() {
insert(5);
String json =
"""
Expand Down Expand Up @@ -177,7 +204,7 @@ public void deleteManyByColumn() {
}

@Test
public void deleteManyNoFilter() {
public void noFilter() {
insert(20);
String json =
"""
Expand Down Expand Up @@ -222,7 +249,7 @@ public void deleteManyNoFilter() {
}

@Test
public void deleteManyNoFilterMoreDataFlag() {
public void noFilterMoreDataFlag() {
insert(25);
String json =
"""
Expand Down Expand Up @@ -278,9 +305,9 @@ public void concurrentDeletes() throws Exception {
String document =
"""
{
"_id": "concurrent-%s"
}
""";
"_id": "concurrent-%s"
}
""";
for (int i = 0; i < totalDocuments; i++) {
insertDoc(document.formatted(i));
}
Expand Down
Loading

0 comments on commit 226475f

Please sign in to comment.