FINERACT-2238: New command processing - Business Date Management (org.apache.fineract.infrastructure.businessdate)
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
d5958f36c7
commit
bb46397daa
@@ -38,8 +38,6 @@ dependencies {
|
||||
'com.github.spotbugs:spotbugs-annotations',
|
||||
'org.mapstruct:mapstruct',
|
||||
'com.lmax:disruptor',
|
||||
'com.ibm.icu:icu4j',
|
||||
'org.yakworks:spring-icu4j',
|
||||
)
|
||||
implementation('org.eclipse.persistence:org.eclipse.persistence.jpa') {
|
||||
exclude group: 'org.eclipse.persistence', module: 'jakarta.persistence'
|
||||
@@ -62,6 +60,7 @@ dependencies {
|
||||
exclude group: 'org.skyscreamer'
|
||||
}
|
||||
testImplementation (
|
||||
project(':fineract-validation'),
|
||||
'org.springframework.boot:spring-boot-starter-web',
|
||||
'org.mockito:mockito-inline',
|
||||
'org.openjdk.jmh:jmh-core',
|
||||
|
||||
@@ -34,6 +34,8 @@ public class Command<T> implements Serializable {
|
||||
|
||||
private UUID id;
|
||||
|
||||
private String idempotencyKey;
|
||||
|
||||
private OffsetDateTime createdAt;
|
||||
|
||||
private String tenantId;
|
||||
|
||||
+1
-2
@@ -16,9 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.command.persistence;
|
||||
package org.apache.fineract.command.persistence.domain;
|
||||
|
||||
import org.apache.fineract.command.persistence.domain.CommandEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import org.springframework.stereotype.Component;
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
public final class CommandJsonMapper {
|
||||
final class CommandJsonMapper {
|
||||
|
||||
private static final String CLASS_ATTRIBUTE = "@class";
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@@ -20,7 +20,7 @@ package org.apache.fineract.command;
|
||||
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.command.persistence.CommandRepository;
|
||||
import org.apache.fineract.command.persistence.domain.CommandRepository;
|
||||
import org.apache.fineract.command.persistence.mapping.CommandMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@@ -23,16 +23,11 @@ import org.apache.fineract.command.core.CommandProperties;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.validation.Validator;
|
||||
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
|
||||
import yakworks.i18n.icu.ICUBundleMessageSource;
|
||||
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@@ -42,22 +37,4 @@ import yakworks.i18n.icu.ICUBundleMessageSource;
|
||||
@EnableAsync
|
||||
@PropertySource("classpath:application-test.properties")
|
||||
@ComponentScan("org.apache.fineract.command.sample")
|
||||
public class TestConfiguration {
|
||||
|
||||
@Bean
|
||||
MessageSource messageSource() {
|
||||
var messageSource = new ICUBundleMessageSource();
|
||||
messageSource.setBasenames("classpath:org.apache.fineract.messages");
|
||||
messageSource.setDefaultEncoding("UTF-8");
|
||||
|
||||
return messageSource;
|
||||
}
|
||||
|
||||
@Bean
|
||||
Validator validatorFactoryBean(MessageSource messageSource) {
|
||||
var localValidatorFactoryBean = new LocalValidatorFactoryBean();
|
||||
localValidatorFactoryBean.setValidationMessageSource(messageSource);
|
||||
|
||||
return localValidatorFactoryBean;
|
||||
}
|
||||
}
|
||||
public class TestConfiguration {}
|
||||
|
||||
+1
-2
@@ -22,7 +22,6 @@ import static org.apache.fineract.command.core.CommandConstants.COMMAND_REQUEST_
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.http.MediaType.APPLICATION_PROBLEM_JSON_VALUE;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.UUID;
|
||||
@@ -56,7 +55,7 @@ class DummyApiController {
|
||||
|
||||
@PostMapping("/sync")
|
||||
DummyResponse dummySync(@RequestHeader(value = COMMAND_REQUEST_ID, required = false) UUID requestId,
|
||||
@RequestHeader(value = "x-fineract-tenant-id", required = false) String tenantId, @Valid @RequestBody DummyRequest request) {
|
||||
@RequestHeader(value = "x-fineract-tenant-id", required = false) String tenantId, @RequestBody DummyRequest request) {
|
||||
var command = new DummyCommand();
|
||||
command.setId(requestId);
|
||||
command.setPayload(request);
|
||||
|
||||
Reference in New Issue
Block a user