Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
admy7 committed Sep 25, 2024
1 parent 2c85648 commit 9d2cc96
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void cannot_accept_terms_when_not_in_submittable_state() {
.when()
.post("/api/v1/applications/2/accept-terms")
.then()
.statusCode(428)
.statusCode(409)
.body("title", equalTo("Application Not In Correct State"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void cannot_attach_file_to_application_when_not_in_submittable_state() {
.when()
.post("/api/v1/applications/2/attachments")
.then()
.statusCode(428);
.statusCode(409);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.junit.jupiter.api.Test;

import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.equalTo;

@QuarkusTest
class DeleteApplicationTest extends BaseTest {
Expand All @@ -31,7 +32,9 @@ void cannot_delete_application_when_not_found() {
.when()
.delete("/api/v1/applications/12345")
.then()
.statusCode(404);
.statusCode(404)
.body("title", equalTo("Application Not Found"))
.body("detail", equalTo("The application was not found."));
}

@Test
Expand All @@ -42,7 +45,8 @@ void cannot_delete_application_when_not_same_applicant() {
.when()
.delete("/api/v1/applications/1")
.then()
.statusCode(403);
.statusCode(403)
.body("title", equalTo("User Not Applicant"));
}

@Test
Expand All @@ -53,7 +57,10 @@ void cannot_delete_application_when_not_draft() {
.when()
.delete("/api/v1/applications/2")
.then()
.statusCode(409);
.statusCode(409)
.body("title", equalTo("Application Not In Correct State"))
.body("detail", equalTo(
"The application is not in correct state: application.state/submitted."));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void cannot_save_application_when_not_in_submittable_state() {
.when()
.post("/api/v1/applications/2/save-forms-and-duos")
.then()
.statusCode(428);
.statusCode(409);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void cannot_submit_application_when_not_in_submittable_state() {
.when()
.post("/api/v1/applications/2/submit")
.then()
.statusCode(428);
.statusCode(409);
}

@Test
Expand Down

0 comments on commit 9d2cc96

Please sign in to comment.