Commit 21734ff6 authored by Bergamote Orange's avatar Bergamote Orange
Browse files

tests(integration-tests): expect 200 OK when 0 visits are accepted

parent 1d6ea9b6
Pipeline #283916 failed with stages
in 8 minutes and 31 seconds
......@@ -136,7 +136,7 @@ public class CleaReportSteps {
.then()
.contentType(ContentType.JSON)
.statusCode(200)
.body("message", equalTo("0 reports processed, 1 rejected"))
.body("message", equalTo("0/1 accepted visits"))
.extract()
.as(WreportResponse.class);
visitor.setLastReportResponse(response);
......@@ -158,8 +158,8 @@ public class CleaReportSteps {
.post(cleaReportUrl)
.then()
.contentType(ContentType.JSON)
.statusCode(400)
.body("message", equalTo("Invalid request"));
.statusCode(200)
.body("message", equalTo("0/1 accepted visits"));
}
@Then("{word} has {int} rejected visit(s)")
......
......@@ -3,7 +3,6 @@ package fr.gouv.clea.integrationtests.service;
import fr.gouv.clea.integrationtests.config.ApplicationProperties;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.springframework.stereotype.Service;
import java.io.BufferedReader;
......
......@@ -13,7 +13,8 @@ public class CleaApiResponseParser {
final var matcher = REPORT_MESSAGE_RESPONSE_PATTERN.matcher(message);
if (!matcher.find()) {
throw new IllegalArgumentException(
String.format("message '%s' doesn't match pattern %s", message, REPORT_MESSAGE_RESPONSE_PATTERN));
String.format("message '%s' doesn't match pattern %s", message, REPORT_MESSAGE_RESPONSE_PATTERN)
);
}
final var accepted = Integer.parseInt(matcher.group(1));
final var total = Integer.parseInt(matcher.group(2));
......
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