File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
integration-tests/src/test/java/org/apache/fineract/integrationtests Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 4040import org .apache .fineract .integrationtests .client .feign .modules .LoanTestData ;
4141import org .apache .fineract .integrationtests .client .feign .modules .LoanTestValidators ;
4242import org .apache .fineract .integrationtests .common .FineractFeignClientHelper ;
43+ import org .apache .fineract .integrationtests .common .loans .LoanTestLifecycleExtension ;
4344import org .junit .jupiter .api .BeforeAll ;
45+ import org .junit .jupiter .api .extension .ExtendWith ;
4446
47+ @ ExtendWith (LoanTestLifecycleExtension .class )
4548public abstract class FeignLoanTestBase extends FeignIntegrationTest implements LoanProductTemplates {
4649
4750 protected static FeignAccountHelper accountHelper ;
Original file line number Diff line number Diff line change 3636import org .apache .fineract .integrationtests .common .FineractClientHelper ;
3737import org .apache .fineract .integrationtests .common .Utils ;
3838import org .junit .jupiter .api .extension .AfterEachCallback ;
39+ import org .junit .jupiter .api .extension .BeforeEachCallback ;
3940import org .junit .jupiter .api .extension .ExtensionContext ;
4041
41- public class LoanTestLifecycleExtension implements AfterEachCallback {
42+ public class LoanTestLifecycleExtension implements AfterEachCallback , BeforeEachCallback {
4243
4344 private LoanTransactionHelper loanTransactionHelper ;
4445 public static final String DATE_FORMAT = "dd MMMM yyyy" ;
4546 private final DateTimeFormatter dateFormatter = new DateTimeFormatterBuilder ().appendPattern (DATE_FORMAT ).toFormatter ();
4647
4748 @ Override
4849 public void afterEach (ExtensionContext context ) {
50+ closeOpenLoans ();
51+ }
52+
53+ @ Override
54+ public void beforeEach (ExtensionContext context ) {
55+ closeOpenLoans ();
56+ }
57+
58+ private void closeOpenLoans () {
4959 BusinessDateHelper .runAt (DateTimeFormatter .ofPattern (DATE_FORMAT ).format (Utils .getLocalDateOfTenant ()), () -> {
5060 this .loanTransactionHelper = new LoanTransactionHelper (null , null );
5161
You can’t perform that action at this time.
0 commit comments