Commit b72e8ddc authored by Bergamote Orange's avatar Bergamote Orange
Browse files

tests(clea-ws-rest): test to verify new rule regarding no valid visits in a report

parent 21734ff6
Pipeline #284842 passed with stages
in 30 minutes and 53 seconds
...@@ -114,6 +114,7 @@ class CleaControllerTest { ...@@ -114,6 +114,7 @@ class CleaControllerTest {
.body( .body(
Map.of( Map.of(
"pivotDate", 0, "pivotDate", 0,
"visits", List.of( "visits", List.of(
Map.of( Map.of(
"qrCode", RandomStringUtils.randomAlphanumeric(20), "qrCode", RandomStringUtils.randomAlphanumeric(20),
...@@ -372,7 +373,7 @@ class CleaControllerTest { ...@@ -372,7 +373,7 @@ class CleaControllerTest {
} }
@Test @Test
void a_report_with_no_valid_visit_causes_400_bad_request() { void a_report_with_no_valid_visit_returns_200_and_visits_are_ignored() {
final var request = ReportRequest.builder() final var request = ReportRequest.builder()
.pivotDate(2L) .pivotDate(2L)
.visits( .visits(
...@@ -388,9 +389,7 @@ class CleaControllerTest { ...@@ -388,9 +389,7 @@ class CleaControllerTest {
.post("/api/clea/v1/wreport") .post("/api/clea/v1/wreport")
.then() .then()
.statusCode(BAD_REQUEST.value()) .statusCode(OK.value())
.body("httpStatus", equalTo(BAD_REQUEST.value()))
.body("timestamp", isStringDateBetweenNowAndTenSecondsAgo())
.body("message", equalTo("0/1 accepted visits")); .body("message", equalTo("0/1 accepted visits"));
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment