FINERACT-1065: Fixing integration test issues

This commit is contained in:
Petri Tuomola
2020-07-03 16:07:58 +02:00
committed by Michael Vorburger ⛑️
parent 1da8060805
commit b61957acb2
5 changed files with 22 additions and 12 deletions
@@ -65,8 +65,10 @@ public class HookIntegrationTest {
// http://www.jamesward.com/2014/06/11/testing-webhooks-was-a-pain-so-i-fixed-the-glitch
final String uniqueId = UUID.randomUUID().toString();
final String payloadURL = "http://echo-webhook.herokuapp.com:80/" + uniqueId + "?";
this.hookHelper.createHook(payloadURL);
final Integer hookId = this.hookHelper.createHook(payloadURL);
Assertions.assertNotNull(hookId);
final Integer createdOfficeID = this.officeHelper.createOffice("01 January 2012");
Assertions.assertNotNull(createdOfficeID);
try {
/**
@@ -93,6 +95,8 @@ public class HookIntegrationTest {
fail("Failed to connect to https://echo-webhook.herokuapp.com platform");
}
throw new RuntimeException(e);
} finally {
this.hookHelper.deleteHook(hookId.longValue());
}
}
@@ -101,7 +101,8 @@ public class AdHocScheduledJobRunnerServiceImpl implements AdHocScheduledJobRunn
.append(adhoc.getQuery());
if (insertSqlBuilder.length() > 0) {
final int result = this.jdbcTemplate.update(insertSqlBuilder.toString());
LOG.info("{}: Results affected by inserted: {}", ThreadLocalContextUtil.getTenant().getName(), result);
LOG.info("{}: Records affected by generateClientSchedule: {}", ThreadLocalContextUtil.getTenant().getName(),
result);
this.jdbcTemplate.update("UPDATE m_adhoc SET last_run=? WHERE id=?", new Date(), adhoc.getId());
}
@@ -111,7 +112,7 @@ public class AdHocScheduledJobRunnerServiceImpl implements AdHocScheduledJobRunn
}
});
} else {
LOG.info("{} Nothing to update", ThreadLocalContextUtil.getTenant().getName());
LOG.info("{}: Nothing to update by generateClientSchedule", ThreadLocalContextUtil.getTenant().getName());
}
}
@@ -126,7 +126,7 @@ public class LoanArrearsAgingServiceImpl implements LoanArrearsAgingService, Bus
result += i;
}
LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
LOG.info("{}: Records affected by updateLoanArrearsAgeingDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result);
}
@Override
@@ -21,11 +21,13 @@ package org.apache.fineract.portfolio.savings.domain;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
public interface SavingsAccountTransactionRepository
extends JpaRepository<SavingsAccountTransaction, Long>, JpaSpecificationExecutor<SavingsAccountTransaction> {
@Query("select sat from SavingsAccountTransaction sat where sat.id = :transactionId and sat.savingsAccount.id = :savingsId")
SavingsAccountTransaction findOneByIdAndSavingsAccountId(Long transactionId, Long savingsId);
SavingsAccountTransaction findOneByIdAndSavingsAccountId(@Param("transactionId") Long transactionId,
@Param("savingsId") Long savingsId);
}
@@ -175,7 +175,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
LOG.info("{}: Records affected by updateLoanSummaryDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result);
}
@Transactional
@@ -210,7 +210,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
LOG.info("{}: Records affected by updateLoanPaidInAdvance: {}", ThreadLocalContextUtil.getTenant().getName(), result);
}
@Override
@@ -234,7 +234,8 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
}
}
LOG.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), annualFeeData.size());
LOG.info("{}: Records affected by applyAnnualFeeForSavings: {}", ThreadLocalContextUtil.getTenant().getName(),
annualFeeData.size());
}
@Override
@@ -259,7 +260,8 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
LOG.error("Apply Charges due for savings failed for account: {}", savingsAccountReference.getAccountNo(), ex);
}
}
LOG.info("{}: Savings accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), chargesDueData.size());
LOG.info("{}: Records affected by applyDueChargesForSavings: {}", ThreadLocalContextUtil.getTenant().getName(),
chargesDueData.size());
if (!exceptions.isEmpty()) {
throw new JobExecutionException(exceptions);
}
@@ -297,7 +299,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
final int result = jdbcTemplate.update(updateSqlBuilder.toString());
LOG.info("{} : Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
LOG.info("{}: Records affected by updateNPA: {}", ThreadLocalContextUtil.getTenant().getName(), result);
}
@Override
@@ -321,7 +323,8 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
}
}
LOG.info("{}: Deposit accounts affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), depositAccounts.size());
LOG.info("{}: Records affected by updateMaturityDetailsOfDepositAccounts: {}", ThreadLocalContextUtil.getTenant().getName(),
depositAccounts.size());
}
@Override
@@ -442,7 +445,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
.append("group by je.account_id, je.office_id, je.transaction_date, Date(je.entry_date)");
final int result = jdbcTemplate.update(sqlBuilder.toString(), formattedDate);
LOG.info("{}: Results affected by update: {}", ThreadLocalContextUtil.getTenant().getName(), result);
LOG.info("{}: Records affected by updateTrialBalanceDetails: {}", ThreadLocalContextUtil.getTenant().getName(), result);
}
// Updating closing balance