increase auto formatting comment line length from 80 to 120
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
9542e35702
commit
c529fdf58c
@@ -29,8 +29,7 @@ import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
/**
|
||||
* Runs a unit test for BatchApiResource by mocking the BatchRequest and
|
||||
* BatchApiService objects.
|
||||
* Runs a unit test for BatchApiResource by mocking the BatchRequest and BatchApiService objects.
|
||||
*
|
||||
* @author Rishabh Shukla
|
||||
*/
|
||||
|
||||
@@ -27,10 +27,9 @@ import io.restassured.specification.RequestSpecification;
|
||||
import io.restassured.specification.ResponseSpecification;
|
||||
|
||||
/**
|
||||
* REST integration tests helper. Intended to encapsulate the current
|
||||
* RestAssured-based implementation as private. May be REST integration tests
|
||||
* should instead be written using e.g. Spring's TestRestTemplate or Square's
|
||||
* Retrofit (already used in the Mifos X Android client).
|
||||
* REST integration tests helper. Intended to encapsulate the current RestAssured-based implementation as private. May
|
||||
* be REST integration tests should instead be written using e.g. Spring's TestRestTemplate or Square's Retrofit
|
||||
* (already used in the Mifos X Android client).
|
||||
*/
|
||||
public class RestAssuredFixture {
|
||||
|
||||
|
||||
@@ -33,11 +33,9 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Util for RestAssured tests. This class here in src/test is copy/pasted :(
|
||||
* from and identical to the one in src/integrationTest; please keep it in sync.
|
||||
* The cunning plan is that, now that we have Spring Boot + MariaDB4j,
|
||||
* eventually do completely away with src/integrationTest and have only
|
||||
* src/test.. can you help? ;)
|
||||
* Util for RestAssured tests. This class here in src/test is copy/pasted :( from and identical to the one in
|
||||
* src/integrationTest; please keep it in sync. The cunning plan is that, now that we have Spring Boot + MariaDB4j,
|
||||
* eventually do completely away with src/integrationTest and have only src/test.. can you help? ;)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class Utils {
|
||||
|
||||
+5
-7
@@ -33,13 +33,11 @@ import org.opentest4j.AssertionFailedError;
|
||||
* </pre>
|
||||
*
|
||||
* <p>
|
||||
* NB that the basepom/duplicate-finder-maven-plugin already runs as part of
|
||||
* odlparent. It has a similar purpose, but covers build time instead of runtime
|
||||
* testing. This JUnit Rule class is thus recommended to be used in particular
|
||||
* in tests which previously ran into JAR Hell issues, and for which
|
||||
* non-regression with a clear failure message in case of future similar
|
||||
* problems is important. (This provides more details at runtime than
|
||||
* duplicate-finder-maven-plugin does at build time.)
|
||||
* NB that the basepom/duplicate-finder-maven-plugin already runs as part of odlparent. It has a similar purpose, but
|
||||
* covers build time instead of runtime testing. This JUnit Rule class is thus recommended to be used in particular in
|
||||
* tests which previously ran into JAR Hell issues, and for which non-regression with a clear failure message in case of
|
||||
* future similar problems is important. (This provides more details at runtime than duplicate-finder-maven-plugin does
|
||||
* at build time.)
|
||||
*
|
||||
* @author Michael Vorburger.ch
|
||||
*/
|
||||
|
||||
+9
-14
@@ -26,16 +26,12 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
|
||||
/**
|
||||
* This integration test ensure that the "production" Spring XML configuration
|
||||
* files (appContext.xml & Co.) are valid. It does not need any database for
|
||||
* that.
|
||||
* This integration test ensure that the "production" Spring XML configuration files (appContext.xml & Co.) are valid.
|
||||
* It does not need any database for that.
|
||||
*
|
||||
* Note: For a simple test like this, contrary to
|
||||
* AbstractSpringBootWithMariaDB4jIntegrationTest, there is no need to use
|
||||
* Boot's SpringApplicationConfiguration here, instead the simpler classic Sring
|
||||
* core ContextConfiguration is sufficient (as long as the
|
||||
* TestsWithoutDatabaseAndNoJobsConfiguration used extends
|
||||
* AbstractApplicationConfiguration).
|
||||
* Note: For a simple test like this, contrary to AbstractSpringBootWithMariaDB4jIntegrationTest, there is no need to
|
||||
* use Boot's SpringApplicationConfiguration here, instead the simpler classic Sring core ContextConfiguration is
|
||||
* sufficient (as long as the TestsWithoutDatabaseAndNoJobsConfiguration used extends AbstractApplicationConfiguration).
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@WebAppConfiguration
|
||||
@@ -44,11 +40,10 @@ import org.springframework.test.context.web.WebAppConfiguration;
|
||||
public class SpringConfigurationTest {
|
||||
|
||||
/**
|
||||
* This tests if "Aal izz well" (i.e. if we can start-up with the [almost]
|
||||
* "production" Spring XML configuration) by doing nothing - it doesn't have
|
||||
* to, as the SpringJUnit4ClassRunner with this @ContextConfiguration will
|
||||
* automatically fail if e.g. there is any invalid Spring XML, an invalid
|
||||
* bean definition somewhere or anything like that.
|
||||
* This tests if "Aal izz well" (i.e. if we can start-up with the [almost] "production" Spring XML configuration) by
|
||||
* doing nothing - it doesn't have to, as the SpringJUnit4ClassRunner with this @ContextConfiguration will
|
||||
* automatically fail if e.g. there is any invalid Spring XML, an invalid bean definition somewhere or anything like
|
||||
* that.
|
||||
*
|
||||
* @see https://www.google.ch/search?q=Aal+izz+well
|
||||
*/
|
||||
|
||||
+6
-9
@@ -26,17 +26,15 @@ import org.mockito.Mockito;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
/**
|
||||
* Spring @Configuration which does not require a running database. It also does
|
||||
* not load any job configuration (as they are in the DB), thus nor starts any
|
||||
* background jobs. For some integration tests, this may be perfectly sufficient
|
||||
* Spring @Configuration which does not require a running database. It also does not load any job configuration (as they
|
||||
* are in the DB), thus nor starts any background jobs. For some integration tests, this may be perfectly sufficient
|
||||
* (and faster to run such tests).
|
||||
*/
|
||||
public class TestsWithoutDatabaseAndNoJobsConfiguration extends AbstractApplicationConfiguration {
|
||||
|
||||
/**
|
||||
* Override TenantDatabaseUpgradeService binding, because the real one has
|
||||
* a @PostConstruct upgradeAllTenants() which accesses the database on
|
||||
* start-up.
|
||||
* Override TenantDatabaseUpgradeService binding, because the real one has a @PostConstruct upgradeAllTenants()
|
||||
* which accesses the database on start-up.
|
||||
*/
|
||||
@Bean
|
||||
public TenantDatabaseUpgradeService tenantDatabaseUpgradeService() {
|
||||
@@ -50,9 +48,8 @@ public class TestsWithoutDatabaseAndNoJobsConfiguration extends AbstractApplicat
|
||||
}
|
||||
|
||||
/**
|
||||
* Override JobRegisterService binding, because the real
|
||||
* JobRegisterServiceImpl has a @PostConstruct loadAllJobs() which accesses
|
||||
* the database on start-up.
|
||||
* Override JobRegisterService binding, because the real JobRegisterServiceImpl has a @PostConstruct loadAllJobs()
|
||||
* which accesses the database on start-up.
|
||||
*/
|
||||
@Bean
|
||||
public JobRegisterService jobRegisterServiceImpl() {
|
||||
|
||||
+1
-2
@@ -55,8 +55,7 @@ public class AdhikarLoanRepaymentScheduleTransactionProcessorTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Scenario 1: Given no overdue installments, current interest due is paid
|
||||
* before principal.
|
||||
* Scenario 1: Given no overdue installments, current interest due is paid before principal.
|
||||
*/
|
||||
@Test
|
||||
public void givenNoOverdueInstallmentsOnTimeRepaymentPaysOffInterestDueFirst() {
|
||||
|
||||
+4
-6
@@ -55,13 +55,11 @@ public class HeavensFamilyLoanRepaymentScheduleTransactionProcessorTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Scenario 1: Single transaction which is less than the interest component
|
||||
* of the first installment.
|
||||
* Scenario 1: Single transaction which is less than the interest component of the first installment.
|
||||
*
|
||||
* Expectation: - First installment shows interest completed equal to that
|
||||
* of transactions, zero principal completed. (payment order interest,
|
||||
* principal) - transaction has interest portion equal to transaction
|
||||
* amount, and zero principal portion
|
||||
* Expectation: - First installment shows interest completed equal to that of transactions, zero principal
|
||||
* completed. (payment order interest, principal) - transaction has interest portion equal to transaction amount,
|
||||
* and zero principal portion
|
||||
*/
|
||||
@Test
|
||||
public void givenSingleOnTimeLoanTransactionShouldPayoffInterestComponentFirst() {
|
||||
|
||||
+2
-3
@@ -30,9 +30,8 @@ import org.apache.fineract.portfolio.loanproduct.domain.InterestMethod;
|
||||
import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRelatedDetail;
|
||||
|
||||
/**
|
||||
* This class is used to keep in one place configurations for setting up
|
||||
* {@link LoanProductRelatedDetail} object used in {@link LoanScheduleGenerator}
|
||||
* 's
|
||||
* This class is used to keep in one place configurations for setting up {@link LoanProductRelatedDetail} object used in
|
||||
* {@link LoanScheduleGenerator} 's
|
||||
*/
|
||||
public class LoanProductRelatedDetailTestHelper {
|
||||
|
||||
|
||||
+6
-10
@@ -34,10 +34,9 @@ public class LoanScheduleTestDataHelper {
|
||||
*
|
||||
* For example: with firstDueDate = 02 July 2011
|
||||
*
|
||||
* Date Principal Interest Interest Waived
|
||||
* ==================================
|
||||
* ================================================ 02 July 2011 1,000 200 0
|
||||
* 02 August 2011 1,000 200 0 02 September 2011 1,000 200 0
|
||||
* Date Principal Interest Interest Waived ==================================
|
||||
* ================================================ 02 July 2011 1,000 200 0 02 August 2011 1,000 200 0 02 September
|
||||
* 2011 1,000 200 0
|
||||
*/
|
||||
public static List<LoanRepaymentScheduleInstallment> createSimpleLoanSchedule(final LocalDate firstDueDate,
|
||||
final MonetaryCurrency currency) {
|
||||
@@ -58,12 +57,9 @@ public class LoanScheduleTestDataHelper {
|
||||
*
|
||||
* For example: with firstDueDate = 02 July 2011
|
||||
*
|
||||
* Date Principal Interest Interest Waived Completed
|
||||
* ========================
|
||||
* ==================================================
|
||||
* ====================================== 02 July 2011 1,000 200 0 true
|
||||
* (principal paid, interest paid) 02 August 2011 1,000 200 0 false 02
|
||||
* September 2011 1,000 200 0 false
|
||||
* Date Principal Interest Interest Waived Completed ========================
|
||||
* ================================================== ====================================== 02 July 2011 1,000 200
|
||||
* 0 true (principal paid, interest paid) 02 August 2011 1,000 200 0 false 02 September 2011 1,000 200 0 false
|
||||
*/
|
||||
public static List<LoanRepaymentScheduleInstallment> createSimpleLoanScheduleWithFirstInstallmentFullyPaid(final LocalDate firstDueDate,
|
||||
final MonetaryCurrency currency) {
|
||||
|
||||
+1
-2
@@ -35,8 +35,7 @@ public class LoanTransactionBuilder {
|
||||
*
|
||||
* LoanTransaction transaction = null;
|
||||
*
|
||||
* if (repayment) { transaction =
|
||||
* LoanTransaction.repayment(transactionAmount, transactionDate); }
|
||||
* if (repayment) { transaction = LoanTransaction.repayment(transactionAmount, transactionDate); }
|
||||
*
|
||||
* return transaction; }
|
||||
**/
|
||||
|
||||
Reference in New Issue
Block a user