Skip to content

Commit

Permalink
MODFIN-283. Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
SerhiiNosko committed Nov 10, 2023
1 parent a94eee6 commit d1ecf64
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public Future<LedgerFiscalYearRolloverProgress> retrieveLedgerRolloverProgressBy

public Future<LedgerFiscalYearRolloverProgressCollection> retrieveLedgerRolloverProgresses(String query, int offset, int limit, RequestContext requestContext) {
var requestEntry = new RequestEntry(resourcesPath(LEDGER_ROLLOVERS_PROGRESS_STORAGE))
.withLimit(limit)
.withOffset(offset)
.withLimit(limit)
.withQuery(query);
return restClient.get(requestEntry.buildEndpoint(), LedgerFiscalYearRolloverProgressCollection.class, requestContext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ private Future<FiscalYear> getFiscalYear(String fiscalYearId, RequestContext req

public Future<Ledger> populateLedgerTotals(Ledger ledger, FiscalYear fiscalYear, RequestContext requestContext) {
return getBudgetsByLedgerIdFiscalYearId(ledger.getId(), fiscalYear.getId(), requestContext)
.map(budgets -> buildHolderSkeleton(fiscalYear.getId(), ledger, budgets))
.compose(holder -> updateHolderWithAllocations(holder, requestContext)
.map(budgets -> buildHolderSkeleton(fiscalYear.getId(), ledger, budgets))
.compose(holder -> updateHolderWithAllocations(holder, requestContext)
.map(holderParam -> {
updateLedgerWithAllocation(holder);
return null;
Expand Down Expand Up @@ -92,7 +92,7 @@ private void updateLedgerWithAllocation(LedgerFiscalYearTransactionsHolder holde
}

private Future<LedgerFiscalYearTransactionsHolder> updateHolderWithAllocations(LedgerFiscalYearTransactionsHolder holder,
RequestContext requestContext) {
RequestContext requestContext) {
List<String> ledgerFundIds = holder.getLedgerFundIds();
String fiscalYearId = holder.getFiscalYearId();
var fromAllocations = baseTransactionService.retrieveFromTransactions(ledgerFundIds, fiscalYearId, List.of(TransactionType.ALLOCATION), requestContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public AcqUnitMembershipsService(RestClient acqUnitMembershipsRestClient) {

public Future<AcquisitionsUnitMembershipCollection> getAcquisitionsUnitsMemberships(String query, int offset, int limit, RequestContext requestContext) {
var requestEntry = new RequestEntry(resourcesPath(ACQUISITIONS_MEMBERSHIPS))
.withLimit(limit)
.withOffset(offset)
.withLimit(limit)
.withQuery(query);
return restClient.get(requestEntry.buildEndpoint(), AcquisitionsUnitMembershipCollection.class, requestContext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public Future<AcquisitionsUnitCollection> getAcquisitionsUnits(String query, int
query = combineCqlExpressions("and", ACTIVE_UNITS_CQL, query);
}
var requestEntry = new RequestEntry(resourcesPath(ACQUISITIONS_UNITS))
.withLimit(limit)
.withOffset(offset)
.withLimit(limit)
.withQuery(query);
return restClient.get(requestEntry.buildEndpoint(), AcquisitionsUnitCollection.class, requestContext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public enum AcqDesiredPermissions {
private static final List<String> values;
static {
values = Arrays.stream(AcqDesiredPermissions.values())
.map(AcqDesiredPermissions::getPermission)
.collect(Collectors.toList());
.map(AcqDesiredPermissions::getPermission)
.collect(Collectors.toList());
}

AcqDesiredPermissions(String permission) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public Future<Void> updateTransaction(Transaction transaction, RequestContext re
}

public Future<Void> deleteTransaction(Transaction transaction, RequestContext requestContext) {
return restClient.delete(resourceByIdPath(TRANSACTIONS,transaction.getId()), requestContext);
return restClient.delete(resourceByIdPath(TRANSACTIONS, transaction.getId()), requestContext);
}

public void validateTransactionType(Transaction transaction, Transaction.TransactionType transactionType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public Transaction.TransactionType getStrategyName() {
private Future<Void> validateDeletion(Transaction encumbrance, RequestContext requestContext) {

return Future.succeededFuture()
.map(v -> {checkEncumbranceStatusNotReleased(encumbrance);
.map(v -> {
checkEncumbranceStatusNotReleased(encumbrance);
return null;
})
.compose(v-> transactionService.isConnectedToInvoice(encumbrance.getId(), requestContext))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public Future<Void> updateTransaction(Transaction payment, RequestContext reques
return Future.succeededFuture()
.map(v -> {
transactionService.validateTransactionType(payment, Transaction.TransactionType.PAYMENT);
if (!Boolean.TRUE.equals(payment.getInvoiceCancelled())){
if (!Boolean.TRUE.equals(payment.getInvoiceCancelled())) {
throw new HttpException(422, UPDATE_PAYMENT_TO_CANCEL_INVOICE.toError());
}
return null;
return null;
})
.compose(v -> transactionService.retrieveTransactionById(payment.getId(), requestContext))
.map(existingTransaction -> {
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/org/folio/services/group/GroupServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ void testShouldRetrieveFundsWithAcqUnits(VertxTestContext vertxTestContext) {

var actGroups = result.result();
assertThat(groupsCollection, equalTo(actGroups));
verify(restClient).get(assertQueryContains(NO_ACQ_UNIT_ASSIGNED_CQL), eq(GroupCollection.class), eq(requestContext))
;
verify(restClient).get(assertQueryContains(NO_ACQ_UNIT_ASSIGNED_CQL), eq(GroupCollection.class), eq(requestContext));
vertxTestContext.completeNow();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ public class LedgerRolloverLogsServiceTest {

@Mock
private RestClient ledgerRolloverLogsRestClientMock;
@
BeforeEach
@BeforeEach
public void initMocks() {
MockitoAnnotations.openMocks(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ void testShouldUseRestClientWhenRetrieveAcqUnitByNotEmptyQuery(VertxTestContext
//When
var future = acqUnitsService.getAcquisitionsUnits("query", 0, 10, requestContext);
vertxTestContext.assertComplete(future)
.onComplete(result -> {
assertTrue(result.succeeded());

var actUnits = result.result();
assertThat(actUnits, equalTo(units));
verify(restClient).get(anyString(), eq(AcquisitionsUnitCollection.class), eq(requestContext));
vertxTestContext.completeNow();
});
.onComplete(result -> {
assertTrue(result.succeeded());

var actUnits = result.result();
assertThat(actUnits, equalTo(units));
verify(restClient).get(anyString(), eq(AcquisitionsUnitCollection.class), eq(requestContext));
vertxTestContext.completeNow();
});
}

@Test
Expand Down

0 comments on commit d1ecf64

Please sign in to comment.