Skip to content

Commit

Permalink
[MODFISTO-460] Fixed HttpException cast
Browse files Browse the repository at this point in the history
  • Loading branch information
damien-git committed Apr 18, 2024
1 parent a200d75 commit b3d4b52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import io.vertx.junit5.VertxTestContext;
import io.vertx.sqlclient.Tuple;
import org.folio.rest.exception.HttpException;
import io.vertx.ext.web.handler.HttpException;
import org.folio.rest.jaxrs.model.Batch;
import org.folio.rest.jaxrs.model.Budget;
import org.folio.rest.jaxrs.model.Fund;
Expand Down Expand Up @@ -305,8 +305,8 @@ void testCreateAllocationWithMissingSourceBudget(VertxTestContext testContext) {
testContext.verify(() -> {
assertThat(event.cause(), instanceOf(HttpException.class));
HttpException exception = (HttpException)event.cause();
assertThat(exception.getCode(), equalTo(500));
assertThat(exception.getMessage(), startsWith("Could not find some budgets in the database"));
assertThat(exception.getStatusCode(), equalTo(500));
assertThat(exception.getPayload(), startsWith("Could not find some budgets in the database"));
});
testContext.completeNow();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,10 @@ void testCreateEncumbranceWithMissingBudget(VertxTestContext testContext) {

testContext.assertFailure(batchTransactionService.processBatch(batch, requestContext))
.onComplete(event -> {
HttpException exception = (HttpException)event.cause();
io.vertx.ext.web.handler.HttpException exception = (io.vertx.ext.web.handler.HttpException)event.cause();
testContext.verify(() -> {
assertEquals(exception.getCode(), 500);
assertThat(exception.getMessage(), startsWith("Could not find some budgets in the database"));
assertEquals(exception.getStatusCode(), 500);
assertThat(exception.getPayload(), startsWith("Could not find some budgets in the database"));
});
testContext.completeNow();
});
Expand Down

0 comments on commit b3d4b52

Please sign in to comment.