Skip to content

Commit

Permalink
Fixing unit test for changeset
Browse files Browse the repository at this point in the history
Signed-off-by: Sunil Jaiswal <[email protected]>
  • Loading branch information
Sunil Jaiswal committed Sep 20, 2024
1 parent 1d5adcb commit 5ba3962
Showing 1 changed file with 4 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@ private void addChangesets() {
new Feature().withId("F").withProperties(new Properties().with("name", "F2"))
)
);

//Version 11
FeatureCollection changeset11 = new FeatureCollection().withFeatures(
Arrays.asList(
new Feature().withId("F").withProperties(new Properties().with("name", "F3"))
)
);

given()
.contentType(APPLICATION_JSON)
Expand Down Expand Up @@ -227,19 +220,11 @@ private void addChangesets() {

given()
.contentType(APPLICATION_JSON)
.headers(getAuthHeaders(AuthProfile.ACCESS_ALL))
.headers(getAuthHeaders(AuthProfile.ACCESS_OWNER_2_ALL))
.body(changeset10.toString())
.post("/spaces/" + cleanUpSpaceId + "/features")
.then()
.statusCode(OK.code());

given()
.contentType(APPLICATION_JSON)
.headers(getAuthHeaders(AuthProfile.ACCESS_OWNER_2_ALL))
.body(changeset11.toString())
.post("/spaces/" + cleanUpSpaceId + "/features")
.then()
.statusCode(OK.code());
}

private void addChangesetsMultipleTimes(int times) {
Expand Down Expand Up @@ -506,7 +491,7 @@ public void validateCompleteChangesetCollection() {
.then()
.statusCode(OK.code())
.body("startVersion", equalTo(1))
.body("endVersion", equalTo(12))
.body("endVersion", equalTo(11))

.body("versions.1.inserted.features.size()", equalTo(2))
.body("versions.1.updated.features.size()", equalTo(0))
Expand Down Expand Up @@ -553,12 +538,8 @@ public void validateCompleteChangesetCollection() {
.body("versions.11.inserted.features.size()", equalTo(0))
.body("versions.11.updated.features.size()", equalTo(1))
.body("versions.11.deleted.features.size()", equalTo(0))

.body("versions.12.inserted.features.size()", equalTo(0))
.body("versions.12.updated.features.size()", equalTo(1))
.body("versions.12.deleted.features.size()", equalTo(0))
.body("versions.12.author", equalTo(AUTHOR_2))
.body("versions.12.createdAt", notNullValue())
.body("versions.11.author", equalTo(AUTHOR_2))
.body("versions.11.createdAt", notNullValue())

.body("nextPageToken", nullValue());
}
Expand Down

0 comments on commit 5ba3962

Please sign in to comment.