fixing failing Client integration tests
This commit is contained in:
+10
-28
@@ -261,7 +261,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult disburseLoan(final Long loanId, final JsonCommand command, Boolean isAccountTransfer) {
|
public CommandProcessingResult disburseLoan(final Long loanId, final JsonCommand command, Boolean isAccountTransfer) {
|
||||||
|
|
||||||
final AppUser currentUser = this.context.authenticatedUser();
|
final AppUser currentUser = getAppUserIfPresent();
|
||||||
|
|
||||||
this.loanEventApiJsonValidator.validateDisbursement(command.json(), isAccountTransfer);
|
this.loanEventApiJsonValidator.validateDisbursement(command.json(), isAccountTransfer);
|
||||||
|
|
||||||
@@ -516,7 +516,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, Object> bulkLoanDisbursal(final JsonCommand command, final CollectionSheetBulkDisbursalCommand bulkDisbursalCommand,
|
public Map<String, Object> bulkLoanDisbursal(final JsonCommand command, final CollectionSheetBulkDisbursalCommand bulkDisbursalCommand,
|
||||||
Boolean isAccountTransfer) {
|
Boolean isAccountTransfer) {
|
||||||
final AppUser currentUser = this.context.authenticatedUser();
|
final AppUser currentUser = getAppUserIfPresent();
|
||||||
|
|
||||||
final SingleDisbursalCommand[] disbursalCommand = bulkDisbursalCommand.getDisburseTransactions();
|
final SingleDisbursalCommand[] disbursalCommand = bulkDisbursalCommand.getDisburseTransactions();
|
||||||
final Map<String, Object> changes = new LinkedHashMap<>();
|
final Map<String, Object> changes = new LinkedHashMap<>();
|
||||||
@@ -643,7 +643,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult undoLoanDisbursal(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult undoLoanDisbursal(final Long loanId, final JsonCommand command) {
|
||||||
|
|
||||||
final AppUser currentUser = this.context.authenticatedUser();
|
final AppUser currentUser = getAppUserIfPresent();
|
||||||
|
|
||||||
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||||
checkClientOrGroupActive(loan);
|
checkClientOrGroupActive(loan);
|
||||||
@@ -768,10 +768,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult adjustLoanTransaction(final Long loanId, final Long transactionId, final JsonCommand command) {
|
public CommandProcessingResult adjustLoanTransaction(final Long loanId, final Long transactionId, final JsonCommand command) {
|
||||||
|
|
||||||
AppUser currentUser = null;
|
AppUser currentUser = getAppUserIfPresent();
|
||||||
if (this.context != null) {
|
|
||||||
currentUser = this.context.authenticatedUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loanEventApiJsonValidator.validateTransaction(command.json());
|
this.loanEventApiJsonValidator.validateTransaction(command.json());
|
||||||
|
|
||||||
@@ -918,7 +915,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult waiveInterestOnLoan(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult waiveInterestOnLoan(final Long loanId, final JsonCommand command) {
|
||||||
|
|
||||||
AppUser currentUser = this.context.authenticatedUser();
|
AppUser currentUser = getAppUserIfPresent();
|
||||||
|
|
||||||
this.loanEventApiJsonValidator.validateTransaction(command.json());
|
this.loanEventApiJsonValidator.validateTransaction(command.json());
|
||||||
|
|
||||||
@@ -1025,7 +1022,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult writeOff(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult writeOff(final Long loanId, final JsonCommand command) {
|
||||||
final AppUser currentUser = this.context.authenticatedUser();
|
final AppUser currentUser = getAppUserIfPresent();
|
||||||
|
|
||||||
this.loanEventApiJsonValidator.validateTransactionWithNoAmount(command.json());
|
this.loanEventApiJsonValidator.validateTransactionWithNoAmount(command.json());
|
||||||
|
|
||||||
@@ -1101,7 +1098,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult closeLoan(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult closeLoan(final Long loanId, final JsonCommand command) {
|
||||||
|
|
||||||
AppUser currentUser = this.context.authenticatedUser();
|
AppUser currentUser = getAppUserIfPresent();
|
||||||
|
|
||||||
this.loanEventApiJsonValidator.validateTransactionWithNoAmount(command.json());
|
this.loanEventApiJsonValidator.validateTransactionWithNoAmount(command.json());
|
||||||
|
|
||||||
@@ -1197,7 +1194,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult closeAsRescheduled(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult closeAsRescheduled(final Long loanId, final JsonCommand command) {
|
||||||
this.context.authenticatedUser();
|
|
||||||
|
|
||||||
this.loanEventApiJsonValidator.validateTransactionWithNoAmount(command.json());
|
this.loanEventApiJsonValidator.validateTransactionWithNoAmount(command.json());
|
||||||
|
|
||||||
@@ -1236,8 +1232,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult addLoanCharge(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult addLoanCharge(final Long loanId, final JsonCommand command) {
|
||||||
|
|
||||||
this.context.authenticatedUser();
|
|
||||||
|
|
||||||
this.loanEventApiJsonValidator.validateAddLoanCharge(command.json());
|
this.loanEventApiJsonValidator.validateAddLoanCharge(command.json());
|
||||||
|
|
||||||
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||||
@@ -1305,10 +1299,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void runScheduleRecalculation(Loan loan) {
|
public void runScheduleRecalculation(Loan loan) {
|
||||||
AppUser currentUser = null;
|
AppUser currentUser = getAppUserIfPresent();
|
||||||
if (this.context != null) {
|
|
||||||
currentUser = this.context.authenticatedUser();
|
|
||||||
}
|
|
||||||
if (loan.repaymentScheduleDetail().isInterestRecalculationEnabled()) {
|
if (loan.repaymentScheduleDetail().isInterestRecalculationEnabled()) {
|
||||||
CalendarInstance restCalendarInstance = calendarInstanceRepository.findCalendarInstaneByEntityId(
|
CalendarInstance restCalendarInstance = calendarInstanceRepository.findCalendarInstaneByEntityId(
|
||||||
loan.loanInterestRecalculationDetailId(), CalendarEntityType.LOAN_RECALCULATION_DETAIL.getValue());
|
loan.loanInterestRecalculationDetailId(), CalendarEntityType.LOAN_RECALCULATION_DETAIL.getValue());
|
||||||
@@ -1433,8 +1424,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult updateLoanCharge(final Long loanId, final Long loanChargeId, final JsonCommand command) {
|
public CommandProcessingResult updateLoanCharge(final Long loanId, final Long loanChargeId, final JsonCommand command) {
|
||||||
|
|
||||||
this.context.authenticatedUser();
|
|
||||||
|
|
||||||
this.loanEventApiJsonValidator.validateUpdateOfLoanCharge(command.json());
|
this.loanEventApiJsonValidator.validateUpdateOfLoanCharge(command.json());
|
||||||
|
|
||||||
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||||
@@ -1465,7 +1454,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult waiveLoanCharge(final Long loanId, final Long loanChargeId, final JsonCommand command) {
|
public CommandProcessingResult waiveLoanCharge(final Long loanId, final Long loanChargeId, final JsonCommand command) {
|
||||||
|
|
||||||
AppUser currentUser = this.context.authenticatedUser();
|
AppUser currentUser = getAppUserIfPresent();
|
||||||
|
|
||||||
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||||
checkClientOrGroupActive(loan);
|
checkClientOrGroupActive(loan);
|
||||||
@@ -1572,8 +1561,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult deleteLoanCharge(final Long loanId, final Long loanChargeId, final JsonCommand command) {
|
public CommandProcessingResult deleteLoanCharge(final Long loanId, final Long loanChargeId, final JsonCommand command) {
|
||||||
|
|
||||||
this.context.authenticatedUser();
|
|
||||||
|
|
||||||
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||||
checkClientOrGroupActive(loan);
|
checkClientOrGroupActive(loan);
|
||||||
final LoanCharge loanCharge = retrieveLoanChargeBy(loanId, loanChargeId);
|
final LoanCharge loanCharge = retrieveLoanChargeBy(loanId, loanChargeId);
|
||||||
@@ -1860,8 +1847,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult loanReassignment(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult loanReassignment(final Long loanId, final JsonCommand command) {
|
||||||
|
|
||||||
this.context.authenticatedUser();
|
|
||||||
|
|
||||||
this.loanEventApiJsonValidator.validateUpdateOfLoanOfficer(command.json());
|
this.loanEventApiJsonValidator.validateUpdateOfLoanOfficer(command.json());
|
||||||
|
|
||||||
final Long fromLoanOfficerId = command.longValueOfParameterNamed("fromLoanOfficerId");
|
final Long fromLoanOfficerId = command.longValueOfParameterNamed("fromLoanOfficerId");
|
||||||
@@ -1894,7 +1879,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult bulkLoanReassignment(final JsonCommand command) {
|
public CommandProcessingResult bulkLoanReassignment(final JsonCommand command) {
|
||||||
|
|
||||||
this.context.authenticatedUser();
|
|
||||||
this.loanEventApiJsonValidator.validateForBulkLoanReassignment(command.json());
|
this.loanEventApiJsonValidator.validateForBulkLoanReassignment(command.json());
|
||||||
|
|
||||||
final Long fromLoanOfficerId = command.longValueOfParameterNamed("fromLoanOfficerId");
|
final Long fromLoanOfficerId = command.longValueOfParameterNamed("fromLoanOfficerId");
|
||||||
@@ -1927,8 +1911,6 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult removeLoanOfficer(final Long loanId, final JsonCommand command) {
|
public CommandProcessingResult removeLoanOfficer(final Long loanId, final JsonCommand command) {
|
||||||
|
|
||||||
this.context.authenticatedUser();
|
|
||||||
|
|
||||||
final LoanUpdateCommand loanUpdateCommand = this.loanUpdateCommandFromApiJsonDeserializer.commandFromApiJson(command.json());
|
final LoanUpdateCommand loanUpdateCommand = this.loanUpdateCommandFromApiJsonDeserializer.commandFromApiJson(command.json());
|
||||||
|
|
||||||
loanUpdateCommand.validate();
|
loanUpdateCommand.validate();
|
||||||
@@ -2442,7 +2424,7 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
|||||||
@Transactional
|
@Transactional
|
||||||
public CommandProcessingResult updateDisbursementDateForTranche(final Long loanId, final Long disbursementId, final JsonCommand command) {
|
public CommandProcessingResult updateDisbursementDateForTranche(final Long loanId, final Long disbursementId, final JsonCommand command) {
|
||||||
|
|
||||||
AppUser currentUser = this.context.authenticatedUser();
|
AppUser currentUser = getAppUserIfPresent();
|
||||||
|
|
||||||
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
final Loan loan = this.loanAssembler.assembleFrom(loanId);
|
||||||
checkClientOrGroupActive(loan);
|
checkClientOrGroupActive(loan);
|
||||||
|
|||||||
Reference in New Issue
Block a user