From 41c1fa51b61a7cb464595c1685eba7be8744b511 Mon Sep 17 00:00:00 2001 From: Andrea Lamparelli Date: Wed, 4 Dec 2024 16:35:10 +0100 Subject: [PATCH] Adapt trash run tests to the new status codes Signed-off-by: Andrea Lamparelli --- .../io/hyperfoil/tools/horreum/svc/RunServiceNoRestTest.java | 2 +- .../io/hyperfoil/tools/horreum/svc/TestServiceNoRestTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/horreum-backend/src/test/java/io/hyperfoil/tools/horreum/svc/RunServiceNoRestTest.java b/horreum-backend/src/test/java/io/hyperfoil/tools/horreum/svc/RunServiceNoRestTest.java index 48e65c9da..7f7e6b401 100644 --- a/horreum-backend/src/test/java/io/hyperfoil/tools/horreum/svc/RunServiceNoRestTest.java +++ b/horreum-backend/src/test/java/io/hyperfoil/tools/horreum/svc/RunServiceNoRestTest.java @@ -109,7 +109,7 @@ private int uploadRun(int testId, String owner, JsonNode runData) { Run run = createSampleRun(testId, runData, owner); try (Response resp = runService.add(String.valueOf(testId), owner, Access.PUBLIC, run)) { - assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus()); + assertEquals(Response.Status.ACCEPTED.getStatusCode(), resp.getStatus()); return Integer.parseInt(resp.getEntity().toString()); } } diff --git a/horreum-backend/src/test/java/io/hyperfoil/tools/horreum/svc/TestServiceNoRestTest.java b/horreum-backend/src/test/java/io/hyperfoil/tools/horreum/svc/TestServiceNoRestTest.java index ec667083a..17c5d63a6 100644 --- a/horreum-backend/src/test/java/io/hyperfoil/tools/horreum/svc/TestServiceNoRestTest.java +++ b/horreum-backend/src/test/java/io/hyperfoil/tools/horreum/svc/TestServiceNoRestTest.java @@ -517,7 +517,7 @@ void testDeleteTestWithRun() { Run run1 = createSampleRun(created1.id, JsonNodeFactory.instance.objectNode(), FOO_TEAM); int runId; try (Response resp = runService.add(created1.name, FOO_TEAM, Access.PUBLIC, run1)) { - assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus()); + assertEquals(Response.Status.ACCEPTED.getStatusCode(), resp.getStatus()); runId = Integer.parseInt(resp.getEntity().toString()); } assertEquals(1, RunDAO.count()); @@ -546,7 +546,7 @@ void testDeleteTestWithAlreadyTrashedRun() { Run run1 = createSampleRun(created1.id, JsonNodeFactory.instance.objectNode(), FOO_TEAM); int runId; try (Response resp = runService.add(created1.name, FOO_TEAM, Access.PUBLIC, run1)) { - assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus()); + assertEquals(Response.Status.ACCEPTED.getStatusCode(), resp.getStatus()); runId = Integer.parseInt(resp.getEntity().toString()); } assertEquals(1, RunDAO.count());