FINERACT-1724: Sonar fixes
Fineract Docker build - MariaDB / build (push) Canceled after 0s
Fineract Docker build - PostgreSQL / build (push) Canceled after 0s
Fineract Kafka Smoke / build (push) Canceled after 0s
Fineract Documentation build / build (push) Canceled after 0s
Fineract Build & Test - MariaDB / build (push) Canceled after 0s
Fineract Build & Test - MySQL / build (push) Canceled after 0s
Fineract Build & Test - PostgreSQL / build (push) Canceled after 0s
Fineract ActiveMQ Smoke / build (push) Canceled after 0s
Fineract Docker build - MariaDB / build (push) Canceled after 0s
Fineract Docker build - PostgreSQL / build (push) Canceled after 0s
Fineract Kafka Smoke / build (push) Canceled after 0s
Fineract Documentation build / build (push) Canceled after 0s
Fineract Build & Test - MariaDB / build (push) Canceled after 0s
Fineract Build & Test - MySQL / build (push) Canceled after 0s
Fineract Build & Test - PostgreSQL / build (push) Canceled after 0s
Fineract ActiveMQ Smoke / build (push) Canceled after 0s
This commit is contained in:
committed by
Adam Saghy
parent
33c1aa7874
commit
d6c10e8303
@@ -17,7 +17,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.springframework.batch.repeat.RepeatStatus.FINISHED;
|
||||
|
||||
import com.acme.fineract.loan.job.AcmeNoopJobTasklet;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@@ -47,7 +48,7 @@ public class AcmeNoopJobTaskletTest {
|
||||
@Test
|
||||
public void testJobExecution() throws Exception {
|
||||
resultStatus = underTest.execute(stepContribution, chunkContext);
|
||||
assertEquals(resultStatus, RepeatStatus.FINISHED);
|
||||
assertEquals(FINISHED, resultStatus);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+7
-5
@@ -19,6 +19,7 @@
|
||||
package org.apache.fineract.client.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Response;
|
||||
|
||||
@@ -27,6 +28,7 @@ import retrofit2.Response;
|
||||
*
|
||||
* @author Michael Vorburger.ch
|
||||
*/
|
||||
@Slf4j
|
||||
public class CallFailedRuntimeException extends RuntimeException {
|
||||
|
||||
private final Call<?> call;
|
||||
@@ -46,17 +48,17 @@ public class CallFailedRuntimeException extends RuntimeException {
|
||||
|
||||
private static String message(Call<?> call, Response<?> response) {
|
||||
StringBuilder sb = new StringBuilder("HTTP failed: " + call.request() + "; " + response);
|
||||
if (response.message() != null && !response.message().isEmpty()) {
|
||||
sb.append("; message: " + response.message());
|
||||
if (null != response.message() && !response.message().isEmpty()) {
|
||||
sb.append("; message: ").append(response.message());
|
||||
}
|
||||
String errorBody;
|
||||
try {
|
||||
errorBody = response.errorBody().string();
|
||||
errorBody = response.errorBody() != null ? response.errorBody().string() : null;
|
||||
if (errorBody != null) {
|
||||
sb.append("; errorBody: " + errorBody);
|
||||
sb.append("; errorBody: ").append(errorBody);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Ignore.
|
||||
log.error("Exception during creating the {} message:", CallFailedRuntimeException.class.getSimpleName(), e);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.google.gson.JsonParseException;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.internal.bind.util.ISO8601Utils;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonToken;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.gsonfire.GsonFireBuilder;
|
||||
import java.io.IOException;
|
||||
@@ -35,10 +36,12 @@ import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.ResponseBody;
|
||||
import org.apache.fineract.client.models.ExternalId;
|
||||
import org.apache.fineract.client.util.adapter.ExternalIdAdapter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import retrofit2.Converter;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
@@ -212,25 +215,28 @@ public class JSON {
|
||||
@Override
|
||||
public Date read(JsonReader in) throws IOException {
|
||||
try {
|
||||
switch (in.peek()) {
|
||||
case NULL:
|
||||
in.nextNull();
|
||||
return null;
|
||||
default:
|
||||
String date = in.nextString();
|
||||
try {
|
||||
if (dateFormat != null) {
|
||||
return dateFormat.parse(date);
|
||||
}
|
||||
return ISO8601Utils.parse(date, new ParsePosition(0));
|
||||
} catch (ParseException e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
if (Objects.requireNonNull(in.peek()) == JsonToken.NULL) {
|
||||
in.nextNull();
|
||||
return null;
|
||||
}
|
||||
String date = in.nextString();
|
||||
return parseDate(date);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Date parseDate(String date) {
|
||||
try {
|
||||
if (null != dateFormat) {
|
||||
return dateFormat.parse(date);
|
||||
}
|
||||
return ISO8601Utils.parse(date, new ParsePosition(0));
|
||||
} catch (ParseException e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The following is not from the generated JSON class, but from the original generated ApiClient.
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
|
||||
public class FineractClientTechnicalTest {
|
||||
|
||||
@Test
|
||||
@Disabled // TODO remove Ignore once https://issues.apache.org/jira/browse/FINERACT-1221 is fixed
|
||||
@Disabled("remove Ignore once https://issues.apache.org/jira/browse/FINERACT-1221 is fixed")
|
||||
void testInvalidOperations() {
|
||||
FineractClient.Builder builder = FineractClient.builder().baseURL("http://test/").tenant("default").basicAuth("mifos", "password");
|
||||
builder.getRetrofitBuilder().validateEagerly(true); // see FINERACT-1221
|
||||
|
||||
-15
@@ -20,11 +20,8 @@ package org.apache.fineract.infrastructure.core.api;
|
||||
|
||||
import jakarta.ws.rs.core.MultivaluedMap;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.infrastructure.core.serialization.JsonParserHelper;
|
||||
@@ -148,16 +145,4 @@ public final class ApiParameterHelper {
|
||||
public static boolean genericResultSetPassed(final MultivaluedMap<String, String> queryParams) {
|
||||
return queryParams.getFirst("genericResultSet") != null;
|
||||
}
|
||||
|
||||
public static Map<String, String> asMap(final MultivaluedMap<String, String> queryParameters) {
|
||||
|
||||
final Map<String, String> map = new HashMap<>(queryParameters.size());
|
||||
|
||||
for (final String parameterName : queryParameters.keySet()) {
|
||||
final List<String> values = queryParameters.get(parameterName);
|
||||
map.put(parameterName, values.get(0));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -61,6 +61,7 @@ public class FineractProperties {
|
||||
private FineractTemplateProperties template;
|
||||
private FineractJpaProperties jpa;
|
||||
|
||||
private FineractDatabaseProperties database;
|
||||
private FineractQueryProperties query;
|
||||
private FineractApiProperties api;
|
||||
private FineractSecurityProperties security;
|
||||
@@ -398,6 +399,13 @@ public class FineractProperties {
|
||||
private boolean statementLoggingEnabled;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class FineractDatabaseProperties {
|
||||
|
||||
private String defaultMasterPassword;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class FineractQueryProperties {
|
||||
|
||||
+16
-39
@@ -18,8 +18,6 @@
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.core.data;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.gson.JsonArray;
|
||||
import java.math.BigDecimal;
|
||||
@@ -176,13 +174,10 @@ public class DataValidatorBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*** FIXME: Vishwas, why does this method have a parameter? Seems wrong ***/
|
||||
/*
|
||||
* This method is not meant for validation, if you have mandatory boolean param and if it has invalid value or value
|
||||
* not passed then call this method, this method is always used with input as false
|
||||
*/
|
||||
public DataValidatorBuilder trueOrFalseRequired1(final boolean trueOfFalseFieldProvided) {
|
||||
if (!trueOfFalseFieldProvided && !this.ignoreNullValue) {
|
||||
public DataValidatorBuilder trueOrFalseRequired(final Object trueOfFalseField) {
|
||||
|
||||
if (trueOfFalseField != null && !trueOfFalseField.toString().equalsIgnoreCase("true")
|
||||
&& !trueOfFalseField.toString().equalsIgnoreCase("false")) {
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".must.be.true.or.false");
|
||||
final StringBuilder defaultEnglishMessage = new StringBuilder("The parameter `").append(this.parameter)
|
||||
@@ -191,22 +186,6 @@ public class DataValidatorBuilder {
|
||||
defaultEnglishMessage.toString(), this.parameter);
|
||||
this.dataValidationErrors.add(error);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataValidatorBuilder trueOrFalseRequired(final Object trueOfFalseField) {
|
||||
|
||||
if (trueOfFalseField != null) {
|
||||
if (!trueOfFalseField.toString().equalsIgnoreCase("true") && !trueOfFalseField.toString().equalsIgnoreCase("false")) {
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".must.be.true.or.false");
|
||||
final StringBuilder defaultEnglishMessage = new StringBuilder("The parameter `").append(this.parameter)
|
||||
.append("` must be set as true or false.");
|
||||
final ApiParameterError error = ApiParameterError.parameterError(validationErrorCode.toString(),
|
||||
defaultEnglishMessage.toString(), this.parameter);
|
||||
this.dataValidationErrors.add(error);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -320,7 +299,7 @@ public class DataValidatorBuilder {
|
||||
final List<Object> rawValuesList = Arrays.asList(values);
|
||||
|
||||
if (this.value == null || !rawValuesList.contains(this.value)) {
|
||||
final List<String> valuesList = Arrays.stream(values).map(Object::toString).collect(toList());
|
||||
final List<String> valuesList = Arrays.stream(values).map(Object::toString).toList();
|
||||
final String valuesListStr = String.join(", ", valuesList);
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".is.not.one.of.expected.enumerations");
|
||||
@@ -349,7 +328,7 @@ public class DataValidatorBuilder {
|
||||
final List<Object> rawValuesList = Arrays.asList(values);
|
||||
|
||||
if (this.value == null || !rawValuesList.contains(this.value.toString().toLowerCase())) {
|
||||
final List<String> valuesList = Arrays.stream(values).map(Object::toString).collect(toList());
|
||||
final List<String> valuesList = Arrays.stream(values).map(Object::toString).toList();
|
||||
final String valuesListStr = String.join(", ", valuesList);
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".is.not.one.of.expected.enumerations");
|
||||
@@ -397,7 +376,7 @@ public class DataValidatorBuilder {
|
||||
final List<Object> rawValuesList = Arrays.asList(values);
|
||||
|
||||
if (rawValuesList.contains(this.value)) {
|
||||
final List<String> valuesList = Arrays.stream(values).map(Object::toString).collect(toList());
|
||||
final List<String> valuesList = Arrays.stream(values).map(Object::toString).toList();
|
||||
final String valuesListStr = String.join(", ", valuesList);
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".is.one.of.unwanted.enumerations");
|
||||
@@ -879,17 +858,15 @@ public class DataValidatorBuilder {
|
||||
}
|
||||
|
||||
public DataValidatorBuilder compareMinAndMaxOfTwoBigDecmimalNos(final BigDecimal min, final BigDecimal max) {
|
||||
if (min != null && max != null) {
|
||||
if (max.compareTo(min) < 0) {
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".is.not.within.expected.range");
|
||||
final StringBuilder defaultEnglishMessage = new StringBuilder("The ").append(" min number ").append(min)
|
||||
.append(" should less than max number ").append(max).append(".");
|
||||
final ApiParameterError error = ApiParameterError.parameterError(validationErrorCode.toString(),
|
||||
defaultEnglishMessage.toString(), this.parameter, min, max);
|
||||
this.dataValidationErrors.add(error);
|
||||
return this;
|
||||
}
|
||||
if (min != null && max != null && max.compareTo(min) < 0) {
|
||||
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
|
||||
.append(this.parameter).append(".is.not.within.expected.range");
|
||||
final StringBuilder defaultEnglishMessage = new StringBuilder("The ").append(" min number ").append(min)
|
||||
.append(" should less than max number ").append(max).append(".");
|
||||
final ApiParameterError error = ApiParameterError.parameterError(validationErrorCode.toString(),
|
||||
defaultEnglishMessage.toString(), this.parameter, min, max);
|
||||
this.dataValidationErrors.add(error);
|
||||
return this;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
+6
-6
@@ -34,8 +34,6 @@ public class DatabasePasswordEncryptor implements PasswordEncryptor {
|
||||
|
||||
public static final String DEFAULT_ENCRYPTION = "AES/CBC/PKCS5Padding";
|
||||
|
||||
public static final String DEFAULT_MASTER_PASSWORD = "fineract";
|
||||
|
||||
private final FineractProperties fineractProperties;
|
||||
|
||||
@SuppressWarnings("checkstyle:regexpsinglelinejava")
|
||||
@@ -54,7 +52,8 @@ public class DatabasePasswordEncryptor implements PasswordEncryptor {
|
||||
@Override
|
||||
public String encrypt(String plainPassword) {
|
||||
String masterPassword = Optional.ofNullable(fineractProperties.getTenant())
|
||||
.map(FineractProperties.FineractTenantProperties::getMasterPassword).orElse(DEFAULT_MASTER_PASSWORD);
|
||||
.map(FineractProperties.FineractTenantProperties::getMasterPassword)
|
||||
.orElse(fineractProperties.getDatabase().getDefaultMasterPassword());
|
||||
String encryption = Optional.ofNullable(fineractProperties.getTenant())
|
||||
.map(FineractProperties.FineractTenantProperties::getEncryption).orElse(DEFAULT_ENCRYPTION);
|
||||
return EncryptionUtil.encryptToBase64(encryption, masterPassword, plainPassword);
|
||||
@@ -63,7 +62,8 @@ public class DatabasePasswordEncryptor implements PasswordEncryptor {
|
||||
@Override
|
||||
public String decrypt(String encryptedPassword) {
|
||||
String masterPassword = Optional.ofNullable(fineractProperties.getTenant())
|
||||
.map(FineractProperties.FineractTenantProperties::getMasterPassword).orElse(DEFAULT_MASTER_PASSWORD);
|
||||
.map(FineractProperties.FineractTenantProperties::getMasterPassword)
|
||||
.orElse(fineractProperties.getDatabase().getDefaultMasterPassword());
|
||||
String encryption = Optional.ofNullable(fineractProperties.getTenant())
|
||||
.map(FineractProperties.FineractTenantProperties::getEncryption).orElse(DEFAULT_ENCRYPTION);
|
||||
return EncryptionUtil.decryptFromBase64(encryption, masterPassword, encryptedPassword);
|
||||
@@ -73,7 +73,7 @@ public class DatabasePasswordEncryptor implements PasswordEncryptor {
|
||||
String masterPassword = Optional.ofNullable(fineractProperties) //
|
||||
.map(FineractProperties::getTenant) //
|
||||
.map(FineractProperties.FineractTenantProperties::getMasterPassword) //
|
||||
.orElse(DEFAULT_MASTER_PASSWORD);
|
||||
.orElse(fineractProperties.getDatabase().getDefaultMasterPassword());
|
||||
return BCrypt.hashpw(masterPassword.getBytes(StandardCharsets.UTF_8), BCrypt.gensalt());
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class DatabasePasswordEncryptor implements PasswordEncryptor {
|
||||
String masterPassword = Optional.ofNullable(fineractProperties) //
|
||||
.map(FineractProperties::getTenant) //
|
||||
.map(FineractProperties.FineractTenantProperties::getMasterPassword) //
|
||||
.orElse(DEFAULT_MASTER_PASSWORD);
|
||||
.orElse(fineractProperties.getDatabase().getDefaultMasterPassword());
|
||||
return BCrypt.checkpw(masterPassword, hashed);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -71,8 +71,7 @@ public final class WorkingDaysUtil {
|
||||
adjustedDateDetailsDTO.setChangedScheduleDate(changedScheduleDate);
|
||||
}
|
||||
|
||||
public static RepaymentRescheduleType getRepaymentRescheduleType(final WorkingDays workingDays, final LocalDate date) {
|
||||
RepaymentRescheduleType rescheduleType = RepaymentRescheduleType.fromInt(workingDays.getRepaymentReschedulingType());
|
||||
return rescheduleType;
|
||||
public static RepaymentRescheduleType getRepaymentRescheduleType(final WorkingDays workingDays) {
|
||||
return RepaymentRescheduleType.fromInt(workingDays.getRepaymentReschedulingType());
|
||||
}
|
||||
}
|
||||
|
||||
+4
-18
@@ -377,30 +377,16 @@ public final class CalendarData implements Serializable {
|
||||
}
|
||||
|
||||
public boolean isStartDateBeforeOrEqual(final LocalDate compareDate) {
|
||||
if (this.startDate != null && compareDate != null) {
|
||||
if (this.startDate.isBefore(compareDate) || this.startDate.equals(compareDate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return this.startDate != null && compareDate != null
|
||||
&& (this.startDate.isBefore(compareDate) || this.startDate.equals(compareDate));
|
||||
}
|
||||
|
||||
public boolean isEndDateAfterOrEqual(final LocalDate compareDate) {
|
||||
if (this.endDate != null && compareDate != null) {
|
||||
if (this.endDate.isAfter(compareDate) || this.endDate.isEqual(compareDate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return this.endDate != null && compareDate != null && (this.endDate.isAfter(compareDate) || this.endDate.isEqual(compareDate));
|
||||
}
|
||||
|
||||
public boolean isBetweenStartAndEndDate(final LocalDate compareDate) {
|
||||
if (isStartDateBeforeOrEqual(compareDate)) {
|
||||
if (this.endDate == null || isEndDateAfterOrEqual(compareDate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return isStartDateBeforeOrEqual(compareDate) && (this.endDate == null || isEndDateAfterOrEqual(compareDate));
|
||||
}
|
||||
|
||||
public boolean isValidRecurringDate(final LocalDate compareDate, final Boolean isSkipMeetingOnFirstDay, final Integer numberOfDays) {
|
||||
|
||||
+10
-44
@@ -153,10 +153,7 @@ public class Calendar extends AbstractAuditableWithUTCDateTimeCustom {
|
||||
|
||||
public static Calendar fromJson(final JsonCommand command) {
|
||||
|
||||
// final Long entityId = command.getSupportedEntityId();
|
||||
// final Integer entityTypeId =
|
||||
// CalendarEntityType.valueOf(command.getSupportedEntityType().toUpperCase()).getValue();
|
||||
LocalTime meetingtime = null;
|
||||
LocalTime meetingtime;
|
||||
final String title = command.stringValueOfParameterNamed(CalendarSupportedParameters.TITLE.getValue());
|
||||
final String description = command.stringValueOfParameterNamed(CalendarSupportedParameters.DESCRIPTION.getValue());
|
||||
final String location = command.stringValueOfParameterNamed(CalendarSupportedParameters.LOCATION.getValue());
|
||||
@@ -304,10 +301,6 @@ public class Calendar extends AbstractAuditableWithUTCDateTimeCustom {
|
||||
final String newMeetingType = CalendarType.fromInt(newValue).name();
|
||||
|
||||
throw new CalendarParameterUpdateNotSupportedException("meeting.type", defaultUserMessage, newMeetingType, oldMeeingType);
|
||||
/*
|
||||
* final Integer newValue = command.integerValueSansLocaleOfParameterNamed(typeParamName);
|
||||
* actualChanges.put(typeParamName, newValue); this.typeId = newValue;
|
||||
*/
|
||||
}
|
||||
|
||||
final String repeatingParamName = CalendarSupportedParameters.REPEATING.getValue();
|
||||
@@ -401,11 +394,9 @@ public class Calendar extends AbstractAuditableWithUTCDateTimeCustom {
|
||||
final Integer interval, final Integer repeatsOnDay, final Integer repeatsOnNthDay) {
|
||||
final Map<String, Object> actualChanges = new LinkedHashMap<>(9);
|
||||
|
||||
if (calendarStartDate != null && this.startDate != null) {
|
||||
if (!calendarStartDate.equals(this.getStartDateLocalDate())) {
|
||||
actualChanges.put("startDate", calendarStartDate);
|
||||
this.startDate = calendarStartDate;
|
||||
}
|
||||
if (calendarStartDate != null && this.startDate != null && !calendarStartDate.equals(this.getStartDateLocalDate())) {
|
||||
actualChanges.put("startDate", calendarStartDate);
|
||||
this.startDate = calendarStartDate;
|
||||
}
|
||||
|
||||
final String newRecurrence = Calendar.constructRecurrence(frequencyType, interval, repeatsOnDay, repeatsOnNthDay);
|
||||
@@ -488,46 +479,21 @@ public class Calendar extends AbstractAuditableWithUTCDateTimeCustom {
|
||||
}
|
||||
|
||||
public boolean isStartDateBeforeOrEqual(final LocalDate compareDate) {
|
||||
if (this.startDate != null && compareDate != null) {
|
||||
if (getStartDateLocalDate().isBefore(compareDate) || getStartDateLocalDate().equals(compareDate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return this.startDate != null && compareDate != null
|
||||
&& (getStartDateLocalDate().isBefore(compareDate) || getStartDateLocalDate().equals(compareDate));
|
||||
}
|
||||
|
||||
public boolean isStartDateAfter(final LocalDate compareDate) {
|
||||
if (this.startDate != null && compareDate != null && getStartDateLocalDate().isAfter(compareDate)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isStartDateAfterOrEqual(final LocalDate compareDate) {
|
||||
if (this.startDate != null && compareDate != null) {
|
||||
if (getStartDateLocalDate().isAfter(compareDate) || getStartDateLocalDate().isEqual(compareDate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return this.startDate != null && compareDate != null && getStartDateLocalDate().isAfter(compareDate);
|
||||
}
|
||||
|
||||
public boolean isEndDateAfterOrEqual(final LocalDate compareDate) {
|
||||
if (this.endDate != null && compareDate != null) {
|
||||
if (getEndDateLocalDate().isAfter(compareDate) || getEndDateLocalDate().isEqual(compareDate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return this.endDate != null && compareDate != null
|
||||
&& (getEndDateLocalDate().isAfter(compareDate) || getEndDateLocalDate().isEqual(compareDate));
|
||||
}
|
||||
|
||||
public boolean isBetweenStartAndEndDate(final LocalDate compareDate) {
|
||||
if (isStartDateBeforeOrEqual(compareDate)) {
|
||||
if (getEndDateLocalDate() == null || isEndDateAfterOrEqual(compareDate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return isStartDateBeforeOrEqual(compareDate) && (getEndDateLocalDate() == null || isEndDateAfterOrEqual(compareDate));
|
||||
}
|
||||
|
||||
private static String constructRecurrence(final JsonCommand command, final Calendar calendar) {
|
||||
|
||||
+5
-18
@@ -104,30 +104,17 @@ public class CalendarHistory extends AbstractPersistableCustom {
|
||||
}
|
||||
|
||||
public boolean isEndDateAfterOrEqual(final LocalDate compareDate) {
|
||||
if (this.endDate != null && compareDate != null) {
|
||||
if (getEndDateLocalDate().isAfter(compareDate) || getEndDateLocalDate().isEqual(compareDate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return this.endDate != null && compareDate != null
|
||||
&& (getEndDateLocalDate().isAfter(compareDate) || getEndDateLocalDate().isEqual(compareDate));
|
||||
}
|
||||
|
||||
public boolean isStartDateBeforeOrEqual(final LocalDate compareDate) {
|
||||
if (this.startDate != null && compareDate != null) {
|
||||
if (getStartDateLocalDate().isBefore(compareDate) || getStartDateLocalDate().equals(compareDate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return this.startDate != null && compareDate != null
|
||||
&& (getStartDateLocalDate().isBefore(compareDate) || getStartDateLocalDate().equals(compareDate));
|
||||
}
|
||||
|
||||
public boolean isBetweenStartAndEndDate(final LocalDate compareDate) {
|
||||
if (isStartDateBeforeOrEqual(compareDate)) {
|
||||
if (getEndDateLocalDate() == null || isEndDateAfterOrEqual(compareDate)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return isStartDateBeforeOrEqual(compareDate) && (getEndDateLocalDate() == null || isEndDateAfterOrEqual(compareDate));
|
||||
}
|
||||
|
||||
public void updateEndDate(LocalDate historyCalEndDate) {
|
||||
|
||||
+2
-2
@@ -833,7 +833,7 @@ public final class CalendarUtils {
|
||||
LocalDate nextRepaymentDate = null;
|
||||
if (applyWorkingDays) {
|
||||
if (WorkingDaysUtil.isNonWorkingDay(workingDays, newRepaymentDate)
|
||||
&& WorkingDaysUtil.getRepaymentRescheduleType(workingDays, newRepaymentDate).isMoveToNextRepaymentDay()) {
|
||||
&& WorkingDaysUtil.getRepaymentRescheduleType(workingDays).isMoveToNextRepaymentDay()) {
|
||||
newRepaymentDate = getNextRepaymentMeetingDate(recurringRule, seedDate, newRepaymentDate.plusDays(1), loanRepaymentInterval,
|
||||
frequency, workingDays, isSkipRepaymentOnFirstDayOfMonth, numberOfDays, isCalledFirstTime, applyWorkingDays);
|
||||
} else {
|
||||
@@ -851,7 +851,7 @@ public final class CalendarUtils {
|
||||
final LocalDate newRepaymentDateTemp = adjustRecurringDate(newRepaymentDate, numberOfDays);
|
||||
if (applyWorkingDays) {
|
||||
if (WorkingDaysUtil.isNonWorkingDay(workingDays, newRepaymentDateTemp)
|
||||
&& WorkingDaysUtil.getRepaymentRescheduleType(workingDays, newRepaymentDateTemp).isMoveToNextRepaymentDay()) {
|
||||
&& WorkingDaysUtil.getRepaymentRescheduleType(workingDays).isMoveToNextRepaymentDay()) {
|
||||
newRepaymentDate = getNextRepaymentMeetingDate(recurringRule, seedDate, newRepaymentDate.plusDays(1),
|
||||
loanRepaymentInterval, frequency, workingDays, isSkipRepaymentOnFirstDayOfMonth, numberOfDays,
|
||||
isCalledFirstTime, applyWorkingDays);
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ public enum DepositAccountType {
|
||||
|
||||
public String resourceName() {
|
||||
|
||||
String resourceName = "INVALID";
|
||||
String resourceName;
|
||||
|
||||
switch (this) {
|
||||
case FIXED_DEPOSIT:
|
||||
|
||||
+5
-10
@@ -28,7 +28,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
@@ -229,14 +228,10 @@ public final class SavingsAccountData implements Serializable {
|
||||
this.savingsAmountOnHold = null;
|
||||
}
|
||||
|
||||
public static final Comparator<SavingsAccountData> ClientNameComparator = new Comparator<SavingsAccountData>() {
|
||||
|
||||
@Override
|
||||
public int compare(SavingsAccountData savings1, SavingsAccountData savings2) {
|
||||
String clientOfSavings1 = savings1.getClientName().toUpperCase(Locale.ENGLISH);
|
||||
String clientOfSavings2 = savings2.getClientName().toUpperCase(Locale.ENGLISH);
|
||||
return clientOfSavings1.compareTo(clientOfSavings2);
|
||||
}
|
||||
public static final Comparator<SavingsAccountData> ClientNameComparator = (savings1, savings2) -> {
|
||||
String clientOfSavings1 = savings1.getClientName().toUpperCase(Locale.ENGLISH);
|
||||
String clientOfSavings2 = savings2.getClientName().toUpperCase(Locale.ENGLISH);
|
||||
return clientOfSavings1.compareTo(clientOfSavings2);
|
||||
};
|
||||
|
||||
public void setNewSavingsAccountTransactionData(final SavingsAccountTransactionData savingsAccountTransactionData) {
|
||||
@@ -395,7 +390,7 @@ public final class SavingsAccountData implements Serializable {
|
||||
}
|
||||
|
||||
public List<SavingsAccountTransactionData> getSavingsAccountTransactionsWithPivotConfig() {
|
||||
return this.transactions.stream().collect(Collectors.toList());
|
||||
return this.transactions.stream().toList();
|
||||
}
|
||||
|
||||
public Boolean isAccrualBasedAccountingEnabledOnSavingsProduct() {
|
||||
|
||||
+3
-3
@@ -167,7 +167,7 @@ public class SavingsAccountSummaryData implements Serializable {
|
||||
this.totalDeposits = wrapper.calculateTotalDeposits(currency, savingsAccountTransactions);
|
||||
this.totalWithdrawals = wrapper.calculateTotalWithdrawals(currency, savingsAccountTransactions);
|
||||
final HashMap<String, Money> map = updateRunningBalanceAndPivotDate(true, savingsAccountTransactions, interestTotal,
|
||||
overdraftInterestTotal, withHoldTaxTotal, currency);
|
||||
overdraftInterestTotal, withHoldTaxTotal);
|
||||
interestTotal = map.get("interestTotal");
|
||||
withHoldTaxTotal = map.get("withHoldTax");
|
||||
overdraftInterestTotal = map.get("overdraftInterestTotal");
|
||||
@@ -200,7 +200,7 @@ public class SavingsAccountSummaryData implements Serializable {
|
||||
@SuppressWarnings("unchecked")
|
||||
private HashMap<String, Money> updateRunningBalanceAndPivotDate(final boolean backdatedTxnsAllowedTill,
|
||||
final List<SavingsAccountTransactionData> savingsAccountTransactions, Money interestTotal, Money overdraftInterestTotal,
|
||||
Money withHoldTaxTotal, CurrencyData currency) {
|
||||
Money withHoldTaxTotal) {
|
||||
boolean isUpdated = false;
|
||||
HashMap<String, Money> map = new HashMap<>();
|
||||
for (int i = savingsAccountTransactions.size() - 1; i >= 0; i--) {
|
||||
@@ -257,7 +257,7 @@ public class SavingsAccountSummaryData implements Serializable {
|
||||
this.totalWithholdTax = wrapper.calculateTotalWithholdTaxWithdrawal(currency, transactions);
|
||||
|
||||
// boolean isUpdated = false;
|
||||
updateRunningBalanceAndPivotDate(false, transactions, null, null, null, currency);
|
||||
updateRunningBalanceAndPivotDate(false, transactions, null, null, null);
|
||||
|
||||
this.accountBalance = Money.of(currency, this.totalDeposits).plus(this.totalInterestPosted).minus(this.totalWithdrawals)
|
||||
.minus(this.totalWithdrawalFees).minus(this.totalAnnualFees).minus(this.totalFeeCharge).minus(this.totalPenaltyCharge)
|
||||
|
||||
-20
@@ -661,16 +661,6 @@ public final class SavingsEnumerations {
|
||||
return optionData;
|
||||
}
|
||||
|
||||
public static List<EnumOptionData> depositTermFrequencyType(final SavingsPeriodFrequencyType[] types) {
|
||||
final List<EnumOptionData> optionDatas = new ArrayList<>();
|
||||
for (final SavingsPeriodFrequencyType type : types) {
|
||||
if (!type.isInvalid()) {
|
||||
optionDatas.add(recurringDepositFrequencyType(type));
|
||||
}
|
||||
}
|
||||
return optionDatas;
|
||||
}
|
||||
|
||||
public static EnumOptionData inMultiplesOfDepositTermFrequencyType(final int id) {
|
||||
return depositTermFrequencyType(SavingsPeriodFrequencyType.fromInt(id));
|
||||
}
|
||||
@@ -702,16 +692,6 @@ public final class SavingsEnumerations {
|
||||
return optionData;
|
||||
}
|
||||
|
||||
public static List<EnumOptionData> inMultiplesOfDepositTermFrequencyType(final SavingsPeriodFrequencyType[] types) {
|
||||
final List<EnumOptionData> optionDatas = new ArrayList<>();
|
||||
for (final SavingsPeriodFrequencyType type : types) {
|
||||
if (!type.isInvalid()) {
|
||||
optionDatas.add(recurringDepositFrequencyType(type));
|
||||
}
|
||||
}
|
||||
return optionDatas;
|
||||
}
|
||||
|
||||
public static EnumOptionData depositType(final Integer id) {
|
||||
return depositType(DepositAccountType.fromInt(id));
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.apache.fineract.cob.COBBusinessStepService;
|
||||
import org.apache.fineract.cob.common.CustomJobParameterResolver;
|
||||
import org.apache.fineract.cob.common.ResetContextTasklet;
|
||||
import org.apache.fineract.cob.conditions.LoanCOBEnabledCondition;
|
||||
import org.apache.fineract.cob.domain.LoanAccountLockRepository;
|
||||
import org.apache.fineract.cob.listener.InlineCOBLoanItemListener;
|
||||
import org.apache.fineract.infrastructure.jobs.domain.CustomJobParameterRepository;
|
||||
import org.apache.fineract.infrastructure.jobs.service.JobName;
|
||||
@@ -60,8 +59,6 @@ public class LoanInlineCOBConfig {
|
||||
@Autowired
|
||||
private COBBusinessStepService cobBusinessStepService;
|
||||
@Autowired
|
||||
private LoanAccountLockRepository accountLockRepository;
|
||||
@Autowired
|
||||
private TransactionTemplate transactionTemplate;
|
||||
@Autowired
|
||||
private CustomJobParameterRepository customJobParameterRepository;
|
||||
|
||||
+3
-2
@@ -134,8 +134,9 @@ public class ChartOfAccountsImportHandler implements ImportHandler {
|
||||
tagIdCodeValueData = new CodeValueData().setId(tagId);
|
||||
}
|
||||
String description = ImportHandlerUtils.readAsString(ChartOfAcountsConstants.DESCRIPTION_COL, row);
|
||||
return GLAccountData.importInstance(accountName, parentId, glCode, manualEntriesAllowed, accountTypeEnum, usageEnum, description,
|
||||
tagIdCodeValueData, row.getRowNum());
|
||||
return new GLAccountData().setName(accountName).setParentId(parentId).setGlCode(glCode)
|
||||
.setManualEntriesAllowed(manualEntriesAllowed).setType(accountTypeEnum).setUsage(usageEnum).setDescription(description)
|
||||
.setTagId(tagIdCodeValueData).setRowIndex(row.getRowNum());
|
||||
}
|
||||
|
||||
private Count importEntity(final Workbook workbook, final List<GLAccountData> glAccounts, final List<JournalEntryData> glTransactions,
|
||||
|
||||
+2
-2
@@ -1867,7 +1867,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
||||
|
||||
private void validateDatatable(final String datatable) {
|
||||
final String sql = "SELECT COUNT(application_table_name) FROM x_registered_table WHERE registered_table_name = ?";
|
||||
final Integer count = jdbcTemplate.queryForObject(sql, Integer.class, datatable);
|
||||
final int count = jdbcTemplate.queryForObject(sql, Integer.class, datatable);
|
||||
if (count == 0) {
|
||||
throw new DatatableNotFoundException(datatable);
|
||||
}
|
||||
@@ -2278,7 +2278,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
|
||||
builder.append(" JOIN m_entity_datatable_check edc ON edc.x_registered_table_name = xrt.registered_table_name");
|
||||
builder.append(" WHERE edc.x_registered_table_name = '" + datatableName + "'");
|
||||
final Long count = this.jdbcTemplate.queryForObject(builder.toString(), Long.class);
|
||||
return count > 0 ? true : false;
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@ public class AmazonS3ConfigCondition extends PropertiesCondition {
|
||||
}
|
||||
|
||||
private boolean isAwsCredentialValid() {
|
||||
try {
|
||||
DefaultCredentialsProvider.create().resolveCredentials();
|
||||
try (var defaultCredentialsProvider = DefaultCredentialsProvider.create()) {
|
||||
defaultCredentialsProvider.resolveCredentials();
|
||||
DefaultAwsRegionProviderChain.builder().build().getRegion();
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ public class TwoFactorConfigurationServiceImpl implements TwoFactorConfiguration
|
||||
@Cacheable(value = "tfConfig", key = "T(org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil).getTenant().getTenantIdentifier()+'|smsProvider'")
|
||||
public Integer getSMSProviderId() {
|
||||
Integer value = getIntegerConfig(TwoFactorConfigurationConstants.SMS_PROVIDER_ID, null);
|
||||
if (value < 1) {
|
||||
if (value == null || value < 1) {
|
||||
return null;
|
||||
}
|
||||
return value;
|
||||
|
||||
+1
-4
@@ -265,10 +265,7 @@ public class CalendarReadPlatformServiceImpl implements CalendarReadPlatformServ
|
||||
+ " ci.entity_type_enum = ?";
|
||||
try {
|
||||
int calendarInstaneId = this.jdbcTemplate.queryForObject(query, Integer.class, entityId, calendarId, entityTypeId);
|
||||
if (calendarInstaneId > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return calendarInstaneId > 0;
|
||||
} catch (final EmptyResultDataAccessException e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-1
@@ -202,7 +202,7 @@ public class DefaultScheduledDateGenerator implements ScheduledDateGenerator {
|
||||
|
||||
while (WorkingDaysUtil.isNonWorkingDay(holidayDetailDTO.getWorkingDays(), adjustedDateDetailsDTO.getChangedScheduleDate())) {
|
||||
final RepaymentRescheduleType repaymentRescheduleType = WorkingDaysUtil
|
||||
.getRepaymentRescheduleType(holidayDetailDTO.getWorkingDays(), adjustedDateDetailsDTO.getChangedScheduleDate());
|
||||
.getRepaymentRescheduleType(holidayDetailDTO.getWorkingDays());
|
||||
|
||||
if (repaymentRescheduleType.isMoveToNextRepaymentDay()) {
|
||||
while (WorkingDaysUtil.isNonWorkingDay(holidayDetailDTO.getWorkingDays(),
|
||||
|
||||
+2
-1
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.apache.fineract.portfolio.loanaccount.service;
|
||||
|
||||
import static java.lang.Boolean.TRUE;
|
||||
import static org.apache.fineract.portfolio.loanproduct.service.LoanEnumerations.interestType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -2153,7 +2154,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService, Loa
|
||||
@Override
|
||||
public boolean isGuaranteeRequired(final Long loanId) {
|
||||
final String sql = "select pl.hold_guarantee_funds from m_loan ml inner join m_product_loan pl on pl.id = ml.product_id where ml.id=?";
|
||||
return this.jdbcTemplate.queryForObject(sql, Boolean.class, loanId);
|
||||
return TRUE.equals(this.jdbcTemplate.queryForObject(sql, Boolean.class, loanId));
|
||||
}
|
||||
|
||||
private static final class LoanTransactionDerivedComponentMapper implements RowMapper<LoanTransactionData> {
|
||||
|
||||
+2
-6
@@ -27,7 +27,6 @@ import org.apache.fineract.portfolio.self.pockets.domain.PocketAccountMapping;
|
||||
import org.apache.fineract.portfolio.self.pockets.domain.PocketAccountMappingRepositoryWrapper;
|
||||
import org.apache.fineract.portfolio.self.pockets.domain.PocketRepositoryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.EmptyResultDataAccessException;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -77,11 +76,8 @@ public class PocketAccountMappingReadPlatformServiceImpl implements PocketAccoun
|
||||
@Override
|
||||
public boolean validatePocketAndAccountMapping(Long pocketId, Long accountId, Integer accountType) {
|
||||
final String sql = "select count(id) from m_pocket_accounts_mapping mapping where pocket_id = ? and account_id = ? and account_type = ?";
|
||||
try {
|
||||
return this.jdbcTemplate.queryForObject(sql, Boolean.class, pocketId, accountId, accountType);
|
||||
} catch (EmptyResultDataAccessException e) {
|
||||
return false;
|
||||
}
|
||||
int count = this.jdbcTemplate.queryForObject(sql, Integer.class, pocketId, accountId, accountType);
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-5
@@ -41,11 +41,8 @@ public class SelfServiceRegistrationReadPlatformServiceImpl implements SelfServi
|
||||
sql = sql + " and mobile_no = ?";
|
||||
params = new Object[] { accountNumber, firstName, lastName, mobileNumber };
|
||||
}
|
||||
Integer count = this.jdbcTemplate.queryForObject(sql, Integer.class, params);
|
||||
if (count == 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
int count = this.jdbcTemplate.queryForObject(sql, Integer.class, params);
|
||||
return count != 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-5
@@ -218,10 +218,7 @@ public class AppUserReadPlatformServiceImpl implements AppUserReadPlatformServic
|
||||
public boolean isUsernameExist(String username) {
|
||||
String sql = "select count(*) from m_appuser where username = ?";
|
||||
Object[] params = new Object[] { username };
|
||||
Integer count = this.jdbcTemplate.queryForObject(sql, Integer.class, params);
|
||||
if (count == 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
int count = this.jdbcTemplate.queryForObject(sql, Integer.class, params);
|
||||
return count != 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,6 +158,7 @@ fineract.report.export.s3.bucket=${FINERACT_REPORT_EXPORT_S3_BUCKET_NAME:}
|
||||
fineract.report.export.s3.enabled=${FINERACT_REPORT_EXPORT_S3_ENABLED:false}
|
||||
|
||||
fineract.jpa.statementLoggingEnabled=${FINERACT_STATEMENT_LOGGING_ENABLED:false}
|
||||
fineract.database.defaultMasterPassword=${FINERACT_DEFAULT_MASTER_PASSWORD:fineract}
|
||||
|
||||
fineract.notification.user-notification-system.enabled=${FINERACT_USER_NOTIFICATION_SYSTEM_ENABLED:true}
|
||||
fineract.logging.json.enabled=${FINERACT_LOGGING_JSON_ENABLED:false}
|
||||
|
||||
@@ -86,6 +86,7 @@ fineract.report.export.s3.bucket=${FINERACT_REPORT_EXPORT_S3_BUCKET_NAME:}
|
||||
fineract.report.export.s3.enabled=${FINERACT_REPORT_EXPORT_S3_ENABLED:false}
|
||||
|
||||
fineract.jpa.statementLoggingEnabled=${FINERACT_STATEMENT_LOGGING_ENABLED:false}
|
||||
fineract.database.defaultMasterPassword=${FINERACT_DEFAULT_MASTER_PASSWORD:fineract}
|
||||
|
||||
fineract.job.loan-cob-enabled=${FINERACT_JOB_LOAN_COB_ENABLED:true}
|
||||
|
||||
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.integrationtests;
|
||||
|
||||
import io.restassured.builder.RequestSpecBuilder;
|
||||
import io.restassured.builder.ResponseSpecBuilder;
|
||||
import io.restassured.http.ContentType;
|
||||
import io.restassured.specification.RequestSpecification;
|
||||
import io.restassured.specification.ResponseSpecification;
|
||||
import org.apache.fineract.integrationtests.common.Utils;
|
||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
||||
public class CurrencyIntegrationTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
private RequestSpecification requestSpec;
|
||||
private SavingsAccountHelper savingsAccountHelper;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user