Merge branch 'conradsp-fix-integration-tests' into develop

This commit is contained in:
conradsp
2018-08-21 15:18:47 -05:00
5 changed files with 44 additions and 37 deletions
@@ -115,10 +115,10 @@ public class ClientEntityImportHandlerTest {
firstClientRow.createCell(ClientEntityConstants.SUBMITTED_ON_COL).setCellValue(submittedDate);
firstClientRow.createCell(ClientEntityConstants.ADDRESS_ENABLED).setCellValue("False");
File directory=new File(System.getProperty("user.home")+"\\Fineract\\bulkimport\\integration_tests\\importhandler\\client") ;
File directory=new File(System.getProperty("user.home")+File.separator+"Fineract"+File.separator+"bulkimport"+File.separator+"integration_tests"+File.separator+"importhandler"+File.separator+"client") ;
if (!directory.exists())
directory.mkdirs();
File file= new File(directory+"\\ClientEntity.xls");
File file= new File(directory+File.separator+"ClientEntity.xls");
OutputStream outputStream=new FileOutputStream(file);
workbook.write(outputStream);
outputStream.close();
@@ -80,27 +80,28 @@ public class LoanImportHandlerTest {
Integer outcome_staff_creation =staffHelper.createStaff(requestSpec,responseSpec);
Assert.assertNotNull("Could not create staff",outcome_staff_creation);
// LoanTransactionHelper ltHelper=new LoanTransactionHelper(requestSpec,responseSpec);
// LoanProductTestBuilder loanProductTestBuilder=new LoanProductTestBuilder();
// String jsonLoanProduct=loanProductTestBuilder.build(null);
// Integer outcome_lp_creaion=ltHelper.getLoanProductId(jsonLoanProduct);
// Assert.assertNotNull("Could not create Loan Product" ,outcome_lp_creaion);
// FundsResourceHandler fundsResourceHandler=new FundsResourceHandler();
// String jsonFund="{\n" +
// "\t\"name\": \""+Utils.randomNameGenerator("Fund_Name",9)+"\"\n" +
// "}";
// Integer outcome_fund_creation=fundsResourceHandler.createFund(jsonFund,requestSpec,responseSpec);
// Assert.assertNotNull("Could not create Fund" ,outcome_fund_creation);
// PaymentTypeHelper paymentTypeHelper=new PaymentTypeHelper();
// String name = PaymentTypeHelper.randomNameGenerator("P_T", 5);
// String description = PaymentTypeHelper.randomNameGenerator("PT_Desc", 15);
// Boolean isCashPayment = true;
// Integer position = 1;
// Integer outcome_payment_creation= paymentTypeHelper.createPaymentType(requestSpec, responseSpec,name,description,isCashPayment,position);
// Assert.assertNotNull("Could not create payment type" ,outcome_payment_creation);
LoanTransactionHelper loanTransactionHelper=new LoanTransactionHelper(requestSpec,responseSpec);
LoanProductTestBuilder loanProductTestBuilder=new LoanProductTestBuilder();
String jsonLoanProduct=loanProductTestBuilder.build(null);
Integer outcome_lp_creaion=loanTransactionHelper.getLoanProductId(jsonLoanProduct);
Assert.assertNotNull("Could not create Loan Product" ,outcome_lp_creaion);
FundsResourceHandler fundsResourceHandler=new FundsResourceHandler();
String jsonFund="{\n" +
"\t\"name\": \""+Utils.randomNameGenerator("Fund_Name",9)+"\"\n" +
"}";
Integer outcome_fund_creation=fundsResourceHandler.createFund(jsonFund,requestSpec,responseSpec);
Assert.assertNotNull("Could not create Fund" ,outcome_fund_creation);
PaymentTypeHelper paymentTypeHelper=new PaymentTypeHelper();
String name = PaymentTypeHelper.randomNameGenerator("P_T", 5);
String description = PaymentTypeHelper.randomNameGenerator("PT_Desc", 15);
Boolean isCashPayment = true;
Integer position = 1;
Integer outcome_payment_creation= paymentTypeHelper.createPaymentType(requestSpec, responseSpec,name,description,isCashPayment,position);
Assert.assertNotNull("Could not create payment type" ,outcome_payment_creation);
Workbook workbook=loanTransactionHelper.getLoanWorkbook("dd MMMM yyyy");
//insert dummy data into loan Sheet
@@ -127,7 +128,7 @@ public class LoanImportHandlerTest {
firstLoanRow.createCell(LoanConstants.NO_OF_REPAYMENTS_COL).setCellValue(loanProductSheet.getRow(1).getCell(6).getNumericCellValue());
firstLoanRow.createCell(LoanConstants.REPAID_EVERY_COL).setCellValue(loanProductSheet.getRow(1).getCell(9).getNumericCellValue());
firstLoanRow.createCell(LoanConstants.REPAID_EVERY_FREQUENCY_COL).setCellValue(loanProductSheet.getRow(1).getCell(10).getStringCellValue());
firstLoanRow.createCell(LoanConstants.LOAN_TERM_COL).setCellValue(loanProductSheet.getRow(1).getCell(8).getNumericCellValue());
firstLoanRow.createCell(LoanConstants.LOAN_TERM_COL).setCellValue(60);
firstLoanRow.createCell(LoanConstants.LOAN_TERM_FREQUENCY_COL).setCellValue(loanProductSheet.getRow(1).getCell(10).getStringCellValue());
firstLoanRow.createCell(LoanConstants.NOMINAL_INTEREST_RATE_COL).setCellValue(loanProductSheet.getRow(1).getCell(11).getNumericCellValue());
firstLoanRow.createCell(LoanConstants.NOMINAL_INTEREST_RATE_FREQUENCY_COL).setCellValue(loanProductSheet.getRow(1).getCell(14).getStringCellValue());
@@ -144,10 +145,12 @@ public class LoanImportHandlerTest {
firstLoanRow.createCell(LoanConstants.LAST_REPAYMENT_DATE_COL).setCellValue(date);
firstLoanRow.createCell(LoanConstants.REPAYMENT_TYPE_COL).setCellValue(extrasSheet.getRow(1).getCell(3).getStringCellValue());
File directory=new File(System.getProperty("user.home")+"\\Fineract\\bulkimport\\integration_tests\\importhandler\\loan") ;
String currentdirectory = new File("").getAbsolutePath();
File directory=new File(currentdirectory+File.separator+"src"+File.separator+"integrationTest"+File.separator+
"resources"+File.separator+"bulkimport"+File.separator+"importhandler"+File.separator+"loan") ;
if (!directory.exists())
directory.mkdirs();
File file= new File(directory+"\\Loan.xls");
File file= new File(directory+File.separator+"Loan.xls");
OutputStream outputStream=new FileOutputStream(file);
workbook.write(outputStream);
outputStream.close();
@@ -157,7 +160,7 @@ public class LoanImportHandlerTest {
Assert.assertNotNull(importDocumentId);
//Wait for the creation of output excel
Thread.sleep(3000);
Thread.sleep(10000);
//check status column of output excel
String location=loanTransactionHelper.getOutputTemplateLocation(importDocumentId);
@@ -74,11 +74,11 @@ public class OfficeImportHandlerTest {
firstOfficeRow.createCell(OfficeConstants.OPENED_ON_COL).setCellValue(date);
String currentdirectory = new File("").getAbsolutePath();
File directory=new File(currentdirectory+"\\src\\integrationTest\\" +
"resources\\bulkimport\\importhandler\\office");
File directory=new File(currentdirectory+File.separator+"src"+File.separator+"integrationTest"+File.separator+
"resources"+File.separator+"bulkimport"+File.separator+"importhandler"+File.separator+"office");
if (!directory.exists())
directory.mkdirs();
File file= new File(directory+"\\Office.xls");
File file= new File(directory+File.separator+"Office.xls");
OutputStream outputStream=new FileOutputStream(file);
workbook.write(outputStream);
outputStream.close();
@@ -118,17 +118,19 @@ public class SavingsImportHandlerTest {
firstSavingsRow.createCell(SavingsConstants.INTEREST_POSTING_PERIOD_COL).setCellValue(savingsProductSheet.getRow(1).getCell(4).getStringCellValue());
firstSavingsRow.createCell(SavingsConstants.INTEREST_CALCULATION_COL).setCellValue(savingsProductSheet.getRow(1).getCell(5).getStringCellValue());
firstSavingsRow.createCell(SavingsConstants.INTEREST_CALCULATION_DAYS_IN_YEAR_COL).setCellValue(savingsProductSheet.getRow(1).getCell(6).getStringCellValue());
firstSavingsRow.createCell(SavingsConstants.MIN_OPENING_BALANCE_COL).setCellValue(savingsProductSheet.getRow(1).getCell(7).getNumericCellValue());
firstSavingsRow.createCell(SavingsConstants.LOCKIN_PERIOD_COL).setCellValue(savingsProductSheet.getRow(1).getCell(8).getNumericCellValue());
firstSavingsRow.createCell(SavingsConstants.LOCKIN_PERIOD_FREQUENCY_COL).setCellValue(savingsProductSheet.getRow(1).getCell(9).getStringCellValue());
firstSavingsRow.createCell(SavingsConstants.MIN_OPENING_BALANCE_COL).setCellValue(1000.0);
firstSavingsRow.createCell(SavingsConstants.LOCKIN_PERIOD_COL).setCellValue(1);
firstSavingsRow.createCell(SavingsConstants.LOCKIN_PERIOD_FREQUENCY_COL).setCellValue("Weeks");
firstSavingsRow.createCell(SavingsConstants.APPLY_WITHDRAWAL_FEE_FOR_TRANSFERS).setCellValue("False");
firstSavingsRow.createCell(SavingsConstants.ALLOW_OVER_DRAFT_COL).setCellValue("False");
firstSavingsRow.createCell(SavingsConstants.OVER_DRAFT_LIMIT_COL).setCellValue(savingsProductSheet.getRow(1).getCell(15).getNumericCellValue());
File directory=new File(System.getProperty("user.home")+"\\Fineract\\bulkimport\\integration_tests\\importhandler\\savings") ;
String currentdirectory = new File("").getAbsolutePath();
File directory=new File(currentdirectory+File.separator+"src"+File.separator+"integrationTest"+File.separator+
"resources"+File.separator+"bulkimport"+File.separator+"importhandler"+File.separator+"savings") ;
if (!directory.exists())
directory.mkdirs();
File file= new File(directory+"\\Savings.xls");
File file= new File(directory+File.separator+"Savings.xls");
OutputStream outputStream=new FileOutputStream(file);
workbook.write(outputStream);
outputStream.close();
@@ -138,7 +140,7 @@ public class SavingsImportHandlerTest {
Assert.assertNotNull(importDocumentId);
//Wait for the creation of output excel
Thread.sleep(3000);
Thread.sleep(10000);
//check status column of output excel
String location=savingsAccountHelper.getOutputTemplateLocation(importDocumentId);
@@ -19,10 +19,12 @@
INSERT INTO `c_configuration` (`id`, `name`, `value`, `enabled`) VALUES (NULL, 'force-password-reset-days', '0', '0');
ALTER TABLE `m_appuser` ADD `last_time_password_updated` DATE NOT NULL ,
ALTER TABLE `m_appuser` ADD `last_time_password_updated` DATE NULL,
ADD INDEX ( `last_time_password_updated` ) ;
UPDATE `m_appuser` SET `last_time_password_updated` = NOW() WHERE `m_appuser`.`last_time_password_updated` ='0000-00-00';
UPDATE `m_appuser` SET `last_time_password_updated` = NOW() WHERE `m_appuser`.`last_time_password_updated` IS NULL;
ALTER TABLE `m_appuser` modify `last_time_password_updated` DATE NOT NULL;
CREATE TABLE IF NOT EXISTS `m_appuser_previous_password` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,