Теперь пути для AllMapStoreTest сетится програмно. Исправил ошибки: не сохранлись поля "ACCOUNT", "COMPANY_ID" у мапсторов AccountHistoryMapStore, BankAccountHistoryMapStore. Изменился тип у поля result в классе SDf17 (теперь нужен BigDecimal, был Integer его не хватает). По цепочке изменил Sdf16Executor, SDf17MapStore.
This commit is contained in:
parent
f7d66bf1b1
commit
94fb771834
7 changed files with 766 additions and 728 deletions
|
|
@ -24,6 +24,7 @@ import ru.spcex.platform.utils.enumeration.EnumMessage;
|
|||
import ru.spcex.platform.utils.enumeration.IMessageResolver;
|
||||
import ru.spcex.platform.utils.validation.IValidator;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
|
@ -34,9 +35,8 @@ import java.util.function.Function;
|
|||
|
||||
@Service
|
||||
public class Sdf16Executor extends AbstractExecutor<SDf16> {
|
||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
private final static DateTimeFormatter datFormatter = DateTimeFormatter.ofPattern("dd.MM.yy");
|
||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||
private final Imdg<Statement> statementImdg;
|
||||
private final Function<SDf16, IValidator> sDf16Validator;
|
||||
private final LoggingService errorLogger;
|
||||
|
|
@ -200,15 +200,15 @@ public class Sdf16Executor extends AbstractExecutor<SDf16> {
|
|||
successSdf.setGenerationId(generationIdForGroup);
|
||||
successSdf.setGenerationTime(Instant.now());
|
||||
successSdf.setInSDf16Id(sdf.getId());
|
||||
successSdf.setResult(0);
|
||||
successSdf.setResult(new BigDecimal(0));
|
||||
return successSdf;
|
||||
}
|
||||
|
||||
private Integer obtainResultNum(EnumMessage error){
|
||||
private BigDecimal obtainResultNum(EnumMessage error) {
|
||||
if (BalanceError.AccountNotPresent.equalsById(error.getSubject().getId()))
|
||||
return 1;
|
||||
return new BigDecimal(1);
|
||||
if (BalanceError.BalanceNotEnough.equalsById(error.getSubject().getId()))
|
||||
return 1;
|
||||
return 9;
|
||||
return new BigDecimal(1);
|
||||
return new BigDecimal(9);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class SDf17 extends SpcexObjectBase implements WithAccount {
|
|||
private BigDecimal bic;
|
||||
private String spec;
|
||||
private BigDecimal number;
|
||||
private Integer result;
|
||||
private BigDecimal result;
|
||||
private Instant generationTime;
|
||||
private Long generationId;
|
||||
private Long inSDf16Id;
|
||||
|
|
@ -93,11 +93,11 @@ public class SDf17 extends SpcexObjectBase implements WithAccount {
|
|||
this.number = value;
|
||||
}
|
||||
|
||||
public Integer getResult() {
|
||||
public BigDecimal getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(Integer value) {
|
||||
public void setResult(BigDecimal value) {
|
||||
this.result = value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class AccountHistoryMapStore extends TemplateEventMapStore<AccountHistory
|
|||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID", "EVENT_TIME", "EVENT_USER_ID",
|
||||
"ACCOUNT_ID", "CREATED_AT", "UPDATED_AT", "ACCOUNT", "ACCOUNT_TYPE", "RELATION_ID", "ACCOUNT_STATUS", "PROCESSING_SIGN"
|
||||
"ACCOUNT_ID", "CREATED_AT", "UPDATED_AT", "ACCOUNT", "ACCOUNT_TYPE", "RELATION_ID", "ACCOUNT_STATUS", "PROCESSING_SIGN", "COMPANY_ID"
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +47,8 @@ public class AccountHistoryMapStore extends TemplateEventMapStore<AccountHistory
|
|||
object.getAccountType(),
|
||||
object.getRelationId(),
|
||||
object.getAccountStatus(),
|
||||
object.getProcessingSign()
|
||||
object.getProcessingSign(),
|
||||
object.getCompanyId()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class BankAccountHistoryMapStore extends TemplateEventMapStore<BankAccoun
|
|||
@Override
|
||||
public String[] getFields() {
|
||||
return new String[]{"ID", "EVENT_TIME", "EVENT_USER_ID",
|
||||
"BANK_ACCOUNT_ID", "ACCOUNT_ID", "BANK_IDENTIFICATION_CODE", "BANK_NAME", "CORRESPONDENT_ACCOUNT", "CORRESPONDENT_ACCOUNT_NAME", "CURRENCY", "DESTINATION", "IBAN", "INTERNATIONAL_TRANSFER_SIGN", "SWIFT_CODE", "TAXPAYER_IDENTIFICATION_NUMBER", "TAX_REGISTRATION_REASON_CODE"
|
||||
"BANK_ACCOUNT_ID", "ACCOUNT_ID", "BANK_IDENTIFICATION_CODE", "BANK_NAME", "CORRESPONDENT_ACCOUNT", "CORRESPONDENT_ACCOUNT_NAME", "CURRENCY", "DESTINATION", "IBAN", "INTERNATIONAL_TRANSFER_SIGN", "SWIFT_CODE", "TAXPAYER_IDENTIFICATION_NUMBER", "TAX_REGISTRATION_REASON_CODE", "ACCOUNT", "COMPANY_ID"
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -53,6 +53,8 @@ public class BankAccountHistoryMapStore extends TemplateEventMapStore<BankAccoun
|
|||
object.getSwiftCode(),
|
||||
object.getTaxpayerIdentificationNumber(),
|
||||
object.getTaxRegistrationReasonCode(),
|
||||
object.getAccount(),
|
||||
object.getCompanyId()
|
||||
};
|
||||
return args;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class SDf17MapStore extends TemplateMapStore<SDf17> {
|
|||
object.setBic(resultSet.getObject("BIC", BigDecimal.class));
|
||||
object.setSpec(resultSet.getObject("SPEC", String.class));
|
||||
object.setNumber(resultSet.getObject("NUMBER", BigDecimal.class));
|
||||
object.setResult(resultSet.getObject("RESULT", Integer.class));
|
||||
object.setResult(resultSet.getObject("RESULT", BigDecimal.class));
|
||||
object.setGenerationTime(getInstantFromTimestamp(resultSet, "GENERATION_TIME"));
|
||||
object.setGenerationId(resultSet.getObject("GENERATION_ID", Long.class));
|
||||
object.setInSDf16Id(resultSet.getObject("IN_S_DF16_ID", Long.class));
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.hazelcast.core.IMap;
|
|||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Assumptions;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -18,7 +19,6 @@ import org.springframework.jdbc.core.SqlTypeValue;
|
|||
import org.springframework.jdbc.core.StatementCreatorUtils;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
import ru.clearing.classes.statics.data.company.Company;
|
||||
import ru.clearing.classes.statics.data.company.CompanyHistory;
|
||||
|
|
@ -39,6 +39,8 @@ import ru.spcex.platform.utils.text.TextUtil;
|
|||
import javax.annotation.PostConstruct;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -51,7 +53,7 @@ import static ru.spcex.clearing.imdg.utils.DbDataUtils.generatingRandomString;
|
|||
TestConfiguration.class,
|
||||
DbTestConnectionConfig.class})
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@TestPropertySource(properties = "spring.config.location=D:/repo/mfd/clearing/clearing-parent/imdg/src/main/resources")
|
||||
//@TestPropertySource(properties = "spring.config.location=D:/repo/mfd/clearing/clearing-parent/imdg/src/main/resources") @TestPropertySource(locations = "/AllMapStoreTest.properties")
|
||||
public class AllMapStoreTest {
|
||||
private static final Long ID = 1000000L;
|
||||
private final Logger log = LoggerFactory.getLogger(this.getClass());
|
||||
|
|
@ -61,6 +63,13 @@ public class AllMapStoreTest {
|
|||
@Autowired
|
||||
JdbcTemplate jdbcTemplate;
|
||||
|
||||
@BeforeAll
|
||||
static void setProperty() {
|
||||
Path path = Paths.get("src", "main", "resources");
|
||||
String currentPath = path.toAbsolutePath().toString();
|
||||
System.setProperty("spring.config.location", currentPath);
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void initTestObjects() {
|
||||
try {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue