Skip to content

Commit

Permalink
[MODFIN-344] - Changed http code
Browse files Browse the repository at this point in the history
  • Loading branch information
Khamidulla Abdulkhakimov authored and Khamidulla Abdulkhakimov committed Jan 3, 2024
1 parent f38783a commit 7799ba3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ramls/budgets.raml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ resourceTypes:
is: [ validate ]
description: Recalculate the budget
responses:
200:
204:
description: "Budget recalculated successfully"
404:
description: "Budget with a given ID not found"
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/folio/rest/impl/BudgetsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void getFinanceBudgetsExpenseClassesTotalsById(String budgetId, Map<Strin
@Override
public void postFinanceBudgetsRecalculateById(String budgetId, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {
recalculateBudgetService.recalculateBudget(budgetId, new RequestContext(vertxContext, okapiHeaders))
.onSuccess(obj -> asyncResultHandler.handle(succeededFuture(buildOkResponse(obj))))
.onSuccess(obj -> asyncResultHandler.handle(succeededFuture(buildNoContentResponse())))
.onFailure(fail -> handleErrorResponse(asyncResultHandler, fail));
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/folio/rest/impl/BudgetsApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ void postFinanceBudgetsRecalculateById() {
when(recalculateBudgetMockService.recalculateBudget(anyString(), ArgumentMatchers.any())).thenReturn(succeededFuture());
String budgetId = UUID.randomUUID().toString();

RestTestUtils.verifyPostResponse(String.format("/finance/budgets/%s/recalculate", budgetId), null, APPLICATION_JSON, 200);
RestTestUtils.verifyPostResponse(String.format("/finance/budgets/%s/recalculate", budgetId), null, "", 204);

verify(recalculateBudgetMockService).recalculateBudget(eq(budgetId), ArgumentMatchers.any());
}
Expand Down

0 comments on commit 7799ba3

Please sign in to comment.