FINERACT-822 Integrating Error Prone
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
896571d479
commit
e10a78b2bd
+8
@@ -31,6 +31,7 @@ import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class StaffTest {
|
||||
@@ -91,6 +92,8 @@ public class StaffTest {
|
||||
StaffHelper.createStaffWithJson(requestSpec, responseSpecForValidationError, new Gson().toJson(map));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore //TODO FINERACT-1005
|
||||
public void testStaffCreateMaxNameLength() {
|
||||
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
@@ -102,6 +105,7 @@ public class StaffTest {
|
||||
StaffHelper.createStaffWithJson(requestSpec, responseSpec, new Gson().toJson(map));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStaffCreateExternalIdValidationError() {
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
|
||||
@@ -183,6 +187,8 @@ public class StaffTest {
|
||||
Assert.assertEquals(mobileNo, changes.get("mobileNo"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // TODO FINERACT- 1005
|
||||
public void testStaffUpdateLongExternalIdError() {
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("externalId", Utils.randomStringGenerator("EXT", 98));
|
||||
@@ -190,6 +196,8 @@ public class StaffTest {
|
||||
StaffHelper.updateStaff(requestSpec, responseSpecForValidationError, 1, map);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // TODO FINERACT- 1005
|
||||
public void testStaffUpdateWrongActiveState() {
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("isActive", "xyz");
|
||||
|
||||
+4
-3
@@ -19,6 +19,7 @@
|
||||
package org.apache.fineract.integrationtests.common;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class OfficeDomain {
|
||||
|
||||
@@ -127,7 +128,7 @@ public class OfficeDomain {
|
||||
hash += this.externalId.hashCode();
|
||||
}
|
||||
if (this.openingDate != null) {
|
||||
hash += this.openingDate.hashCode();
|
||||
hash += Arrays.hashCode(this.openingDate);
|
||||
}
|
||||
if (this.hierarchy != null) {
|
||||
hash += this.hierarchy.hashCode();
|
||||
@@ -151,11 +152,11 @@ public class OfficeDomain {
|
||||
if (this.id == od.getId() && this.name.equals(od.getName())
|
||||
&& this.nameDecorated.equals(od.getName())
|
||||
&& this.externalId.equals(od.getExternalId())
|
||||
&& this.openingDate.equals(od.getOpeningDate())
|
||||
&& Arrays.equals(this.openingDate, od.getOpeningDate())
|
||||
&& this.hierarchy.equals(od.getHierarchy())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -284,13 +284,14 @@ public class VariableInstallmentsDecliningBalanceHelper {
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
public static String formatDate(ArrayList list) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.set(Calendar.YEAR, (int) list.get(0));
|
||||
cal.set(Calendar.MONTH, (int) list.get(1) - 1);
|
||||
cal.set(Calendar.DAY_OF_MONTH, (int) list.get(2));
|
||||
Date date = cal.getTime();
|
||||
DateFormat requiredFormat = new SimpleDateFormat("dd MMMM YYYY");
|
||||
DateFormat requiredFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
return requiredFormat.format(date);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -209,7 +209,7 @@ public class VariableInstallmentsFlatHelper {
|
||||
cal.set(Calendar.MONTH, (int) list.get(1) - 1);
|
||||
cal.set(Calendar.DAY_OF_MONTH, (int) list.get(2));
|
||||
Date date = cal.getTime();
|
||||
DateFormat requiredFormat = new SimpleDateFormat("dd MMMM YYYY");
|
||||
DateFormat requiredFormat = new SimpleDateFormat("dd MMMM yyyy");
|
||||
return requiredFormat.format(date);
|
||||
}
|
||||
|
||||
|
||||
+7
-3
@@ -88,9 +88,13 @@ public class MathUtil {
|
||||
/** @return calculates minimum of the two values considering null values
|
||||
* @param notNull if true then null parameter is omitted, otherwise returns null */
|
||||
public static Long min(Long first, Long second, boolean notNull) {
|
||||
return first == null
|
||||
? (notNull ? second : null)
|
||||
: second == null ? (notNull ? first : null) : Math.min(first, second);
|
||||
if (first == null){
|
||||
return notNull ? second : null;
|
||||
}
|
||||
if (second == null) {
|
||||
return notNull ? first : null;
|
||||
}
|
||||
return Math.min(first, second);
|
||||
}
|
||||
|
||||
/** @return calculates minimum of the values considering null values
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class FloatingRateDTO {
|
||||
public BigDecimal fetchBaseRate(LocalDate date) {
|
||||
BigDecimal rate = null;
|
||||
for (FloatingRatePeriodData periodData : this.baseLendingRatePeriods) {
|
||||
final LocalDate periodFromDate = new LocalDate(periodData.getFromDate());
|
||||
final LocalDate periodFromDate = periodData.getFromDate();
|
||||
if (periodFromDate.isBefore(date) || periodFromDate.isEqual(date)) {
|
||||
rate = periodData.getInterestRate();
|
||||
break;
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class FloatingRatePeriodData implements
|
||||
}
|
||||
|
||||
public LocalDate getFromDateAsLocalDate() {
|
||||
return new LocalDate(this.fromDate);
|
||||
return this.fromDate;
|
||||
}
|
||||
|
||||
public BigDecimal getInterestRate() {
|
||||
|
||||
+2
-2
@@ -1657,7 +1657,7 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
||||
|
||||
for (SavingsAccountTransaction transaction : savingsAccount.getTransactions()) {
|
||||
if ((transaction.getTransactionLocalDate().isEqual(transferDate)
|
||||
&& transaction.getTransactionLocalDate().isAfter(new LocalDate(transferDate)))
|
||||
&& transaction.getTransactionLocalDate().isAfter(transferDate))
|
||||
|| transaction.getTransactionLocalDate().isAfter(transferDate)) {
|
||||
throw new GeneralPlatformDomainRuleException(TransferApiConstants.transferClientSavingsException,
|
||||
TransferApiConstants.transferClientSavingsException, new LocalDate(transaction.createdDate()),
|
||||
@@ -1667,4 +1667,4 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user