diff --git a/src/main/java/io/github/genomicdatainfrastructure/daam/mappers/ApplicationNotInCorrectStateExceptionMapper.java b/src/main/java/io/github/genomicdatainfrastructure/daam/mappers/ApplicationNotInCorrectStateExceptionMapper.java index 460aa4a..b70c985 100644 --- a/src/main/java/io/github/genomicdatainfrastructure/daam/mappers/ApplicationNotInCorrectStateExceptionMapper.java +++ b/src/main/java/io/github/genomicdatainfrastructure/daam/mappers/ApplicationNotInCorrectStateExceptionMapper.java @@ -12,6 +12,6 @@ public class ApplicationNotInCorrectStateExceptionMapper implements ExceptionMapper { @Override public Response toResponse(ApplicationNotInCorrectStateException exception) { - return Response.status(Response.Status.BAD_REQUEST).entity(exception.getMessage()).build(); + return Response.status(Response.Status.PRECONDITION_REQUIRED).entity(exception.getMessage()).build(); } } diff --git a/src/test/java/io/github/genomicdatainfrastructure/daam/api/ApplicationCommandApiImplTest.java b/src/test/java/io/github/genomicdatainfrastructure/daam/api/ApplicationCommandApiImplTest.java index d0f678e..aa5b090 100644 --- a/src/test/java/io/github/genomicdatainfrastructure/daam/api/ApplicationCommandApiImplTest.java +++ b/src/test/java/io/github/genomicdatainfrastructure/daam/api/ApplicationCommandApiImplTest.java @@ -81,7 +81,7 @@ void submitApplication_when_application_not_in_submittable_state() { .when() .post("/api/v1/applications/2/submit") .then() - .statusCode(400); + .statusCode(428); }