Commit 10c70746 authored by Enriko Käsper's avatar Enriko Käsper
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Enriko Käsper

See merge request teis/classifiers-service!66
parents ebdc38d1 87bddbe7
# Changelog
## [1.13.0] - 2020-10-30
* removed Camunda BPMN dependency
* updated Spring Boot framework to version 2.3.4.RELEASE
* updated teis-gradle-plugin version to latest which contains different Gradle dependency configuration sets (functionalities) and therefore Gradle configuration was stripped down from microservice configuration
* updated Gradle Wrapper to version 5.6.4
\ No newline at end of file
......@@ -55,9 +55,7 @@ allprojects {
}
dependencies {
compile ("ee.sm.ti.teis:domain-request-lib:${commonsVersion}")
compile ("ee.sm.ti.teis:domain-cache-lib:${commonsVersion}")
compile "ee.sm.ti.teis:common-api-gateway-lib:${commonApiGatewayVersion}"
compile "ee.sm.ti.teis:service-common-lib:${commonsVersion}"
compile "ee.sm.ti.teis:scheduler-service-lib:${schedulerVersion}"
compile "ee.sm.ti.teis:office-api-gateway-lib:${officeApiGatewayVersion}"
......
theGroup=ee.sm.ti.teis
theVersion=1.12.0
commonsVersion=1.10.0
commonApiGatewayVersion=1.11.0
officeApiGatewayVersion=1.11.0
schedulerVersion=1.5.0
pluginVersion=1.1.1
mapstructVersion=1.3.0.Final
querydslVersion=4.1.3
theVersion=1.13.0
commonsVersion=1.14.0
officeApiGatewayVersion=1.14.0
schedulerVersion=1.12.0
pluginVersion=1.2.0
......@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://repo.tehik.ee/artifactory/gradle-distributions/gradle-5.2.1-bin.zip
distributionUrl=https\://repo.tehik.ee/artifactory/gradle-distributions/gradle-5.6.4-bin.zip
......@@ -8,30 +8,5 @@ functionalities {
apply from: this.getClass().getClassLoader().getResource('teis.integrationTest.gradle')
apply from: this.getClass().getClassLoader().getResource('teis.microservice.gradle')
dependencies {
// Spring
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
compile 'org.springframework.boot:spring-boot-starter-amqp'
compile 'org.springframework.boot:spring-boot-starter-actuator'
// BPM
compile "org.camunda.bpm.springboot:camunda-bpm-spring-boot-starter-webapp:3.2.1"
// Misc
compile 'org.apache.commons:commons-lang3:3.8.1'
compile("com.querydsl:querydsl-core:${querydslVersion}")
compile("com.querydsl:querydsl-jpa:${querydslVersion}")
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor(
"org.mapstruct:mapstruct-processor:${mapstructVersion}",
"com.querydsl:querydsl-apt:${querydslVersion}:jpa",
"org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final",
"javax.annotation:javax.annotation-api:1.3.2",
)
testAnnotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
}
// Define the main class for the application
mainClassName = 'ee.sm.ti.teis.App'
......@@ -18,10 +18,10 @@ import org.testcontainers.junit.jupiter.Testcontainers;
@ContextConfiguration(initializers = { ClassifierTestBase.Initializer.class })
public abstract class ClassifierTestBase {
private static final GenericContainer rabbitMQContainer;
private static final GenericContainer<?> rabbitMQContainer;
static {
rabbitMQContainer = new GenericContainer("rabbitmq:latest").withExposedPorts(5672);
rabbitMQContainer = new GenericContainer<>("rabbitmq:latest").withExposedPorts(5672);
rabbitMQContainer.start();
}
......
......@@ -34,7 +34,11 @@ class ClassifierDefinitionGwListenerTest extends ClassifierTestBase {
@Inject
private ClassifierDefinitionGwListener classifierDefinitionListener;
RequestMetaDTO requestMetaDTO;
RequestMetaDTO requestMetaDTO = RequestMetaDTO.builder()
.requestId(randomUUID().toString())
.userId(randomUUID().toString())
.userType(OFFICIAL_USER)
.build();
ClassifierDefinitionRequest request = new ClassifierDefinitionRequest();
ClassifierDefinitionsOfficeRequest definitionsOfficeRequest = new ClassifierDefinitionsOfficeRequest();
ClassifierDefinitionOfficeRequest definitionOfficeRequest = new ClassifierDefinitionOfficeRequest();
......@@ -111,7 +115,7 @@ class ClassifierDefinitionGwListenerTest extends ClassifierTestBase {
@Test
void getGwDefinitionByCode() {
payload.setCode("COUNTRY");
request.setPayload(payload, new RequestMetaDTO());
request.setPayload(payload, requestMetaDTO);
ClassifierDefinitionFieldResponse defaultValue = classifierDefinitionListener.getDefaultValue(request);
assertThat("EE").isEqualTo(defaultValue.getPayload().getCode());
}
......@@ -119,7 +123,7 @@ class ClassifierDefinitionGwListenerTest extends ClassifierTestBase {
@Test
void getClassifierDefinitionByWrongCodeTest() {
payload.setCode("COUTRY");
request.setPayload(payload, new RequestMetaDTO());
request.setPayload(payload, requestMetaDTO);
ClassifierDefinitionFieldResponse defaultValue = classifierDefinitionListener.getDefaultValue(request);
assertThat(HttpStatus.NOT_FOUND).isEqualTo(defaultValue.getError().getHttpResponse());
}
......
......@@ -9,21 +9,29 @@ import org.junit.jupiter.api.Test;
import javax.inject.Inject;
import static ee.sm.ti.teis.servicerequest.UserType.OFFICIAL_USER;
import static java.util.UUID.randomUUID;
import static org.assertj.core.api.Assertions.assertThat;
class ClassifierDefinitionMsListenerTest extends ClassifierTestBase {
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder()
.requestId(randomUUID().toString())
.userId(randomUUID().toString())
.userType(OFFICIAL_USER)
.build();
@Inject
private ClassifierDefinitionMsListener classifierDefinitionListener;
QueueConfig.ClassifierDefinitionDomainRequest domainRequest = new QueueConfig.ClassifierDefinitionDomainRequest();
ClassifierDefinition classifierDefinition = new ClassifierDefinition();
@Test
void getMsDefinitionByCode() {
classifierDefinition.setCode("COUNTRY");
domainRequest.setPayload(classifierDefinition, new RequestMetaDTO());
domainRequest.setPayload(classifierDefinition, REQUEST_META_DTO);
ClassifierDefinitionMsListener.ClassifierDefinitionResponseMessage msClassifierDefinition =
classifierDefinitionListener.getMsClassifierDefinition(domainRequest);
assertThat("EE").isEqualTo(msClassifierDefinition.getPayload().getDefaultValue());
......
......@@ -11,11 +11,19 @@ import javax.inject.Inject;
import static ee.sm.ti.teis.classifiers.rabbit.QueueConfig.ClassifierItemDomainRequest;
import static ee.sm.ti.teis.classifiers.rabbit.QueueConfig.ClassifierItemsDomainRequest;
import static ee.sm.ti.teis.servicerequest.UserType.OFFICIAL_USER;
import static java.util.UUID.randomUUID;
import static org.assertj.core.api.Assertions.assertThat;
class ClassifierItemsMsListenerTest extends ClassifierTestBase {
public static final String CLASSIFIER_DEFINITION_COUNTRY = "COUNTRY";
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder()
.requestId(randomUUID().toString())
.userId(randomUUID().toString())
.userType(OFFICIAL_USER)
.build();
private static final String CLASSIFIER_DEFINITION_COUNTRY = "COUNTRY";
@Inject
ClassifierItemsMsListener classifierItemsMsListener;
......@@ -24,7 +32,7 @@ class ClassifierItemsMsListenerTest extends ClassifierTestBase {
ClassifierItem itemPayload = new ClassifierItem();
itemPayload.setId("COUNTRY__AF");
ClassifierItemDomainRequest domainRequest = new ClassifierItemDomainRequest();
domainRequest.setPayload(itemPayload, new RequestMetaDTO());
domainRequest.setPayload(itemPayload, REQUEST_META_DTO);
ClassifierItemsMsListener.ClassifierItemResponseMessage defaultValue =
classifierItemsMsListener.getMsClassifierItem(domainRequest);
......@@ -37,7 +45,7 @@ class ClassifierItemsMsListenerTest extends ClassifierTestBase {
ClassifierItem itemPayload = new ClassifierItem();
itemPayload.setClassifierDefinitionId(CLASSIFIER_DEFINITION_COUNTRY);
ClassifierItemsDomainRequest domainsRequest = new ClassifierItemsDomainRequest();
domainsRequest.setPayload(itemPayload, new RequestMetaDTO());
domainsRequest.setPayload(itemPayload, REQUEST_META_DTO);
ClassifierItemsResponseMessage defaultValue =
classifierItemsMsListener.getMsClassifierItems(domainsRequest);
......
......@@ -15,47 +15,55 @@ import org.springframework.http.HttpStatus;
import javax.inject.Inject;
import javax.transaction.Transactional;
import static ee.sm.ti.teis.servicerequest.UserType.OFFICIAL_USER;
import static ee.sm.ti.teis.utils.TestUtils.assertBadRequest;
import static java.util.UUID.randomUUID;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
class ClassifierItemsPublicListenerTest extends ClassifierTestBase {
public static final String CLASSIFIER_DEFINITION_COUNTRY = "COUNTRY";
@Inject
ClassifierItemsPublicListener classifierItemsPublicListener;
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder()
.requestId(randomUUID().toString())
.userId(randomUUID().toString())
.userType(OFFICIAL_USER)
.build();
private final ClassifierItemRequest request = new ClassifierItemRequest();
private final ClassifierItemRequest.Parameters payload = new ClassifierItemRequest.Parameters();
private static final String CLASSIFIER_DEFINITION_COUNTRY = "COUNTRY";
private final ClassifierItemRequest itemRequest = new ClassifierItemRequest();
private final ClassifierItemRequest.Parameters itemPayload = new ClassifierItemRequest.Parameters();
private final ClassifierItemsRequest itemsRequest = new ClassifierItemsRequest();
private final ClassifierItemsRequest.Parameters itemsPayload = new ClassifierItemsRequest.Parameters();
private final ClassifierItemSearchFilterDto search = new ClassifierItemSearchFilterDto();
@Inject
ClassifierItemsPublicListener classifierItemsPublicListener;
@Test
void getClassifierItemByIdTest() {
payload.setId("COUNTRY__AF");
request.setPayload(payload, new RequestMetaDTO());
itemPayload.setId("COUNTRY__AF");
itemRequest.setPayload(itemPayload, REQUEST_META_DTO);
ClassifierItemResponse defaultValue = classifierItemsPublicListener.getClassifierItem(request);
ClassifierItemResponse defaultValue = classifierItemsPublicListener.getClassifierItem(itemRequest);
assertThat("Afganistan").isEqualTo(defaultValue.getPayload().getName());
}
@Test
void getClassifierItemByIdAndLinkedTarget_empty_result() {
payload.setId("CITY_OR_PARISH__0130");
payload.setLinkedItems(LinkedItems.BOTH);
request.setPayload(payload, new RequestMetaDTO());
ClassifierItemResponse response = classifierItemsPublicListener.getClassifierItem(request);
itemPayload.setId("CITY_OR_PARISH__0130");
itemPayload.setLinkedItems(LinkedItems.BOTH);
itemRequest.setPayload(itemPayload, REQUEST_META_DTO);
ClassifierItemResponse response = classifierItemsPublicListener.getClassifierItem(itemRequest);
assertTrue(response.getPayload().getLinkedItems().isEmpty());
}
@Test
void getClassifierItemByWrongIdTest() {
payload.setId("COUNTRY:_AF");
request.setPayload(payload, new RequestMetaDTO());
itemPayload.setId("COUNTRY:_AF");
itemRequest.setPayload(itemPayload, REQUEST_META_DTO);
ClassifierItemResponse defaultValue = classifierItemsPublicListener.getClassifierItem(request);
ClassifierItemResponse defaultValue = classifierItemsPublicListener.getClassifierItem(itemRequest);
assertThat(HttpStatus.NOT_FOUND).isEqualTo(defaultValue.getError().getHttpResponse());
}
......@@ -65,7 +73,7 @@ class ClassifierItemsPublicListenerTest extends ClassifierTestBase {
search.setDefinitionId(CLASSIFIER_DEFINITION_COUNTRY);
search.setItemCode("EE");
itemsPayload.setSearchFilterDto(search);
itemsRequest.setPayload(itemsPayload, new RequestMetaDTO());
itemsRequest.setPayload(itemsPayload, REQUEST_META_DTO);
ClassifierItemsResponse defaultValue = classifierItemsPublicListener.getClassifierItems(itemsRequest);
......@@ -78,7 +86,7 @@ class ClassifierItemsPublicListenerTest extends ClassifierTestBase {
search.setDefinitionId("INSPECTION_TOPIC");
search.setUpperClassifierItemId("INSPECTION_TOPIC__TOOVAHEND");
itemsPayload.setSearchFilterDto(search);
itemsRequest.setPayload(itemsPayload, new RequestMetaDTO());
itemsRequest.setPayload(itemsPayload, REQUEST_META_DTO);
ClassifierItemsResponse response = classifierItemsPublicListener.getClassifierItems(itemsRequest);
......@@ -91,10 +99,10 @@ class ClassifierItemsPublicListenerTest extends ClassifierTestBase {
search.setDefinitionId("INSPECTION_TOPIC");
search.setUpperClassifierItemId("COUNTY__0037");
itemsPayload.setSearchFilterDto(search);
itemsRequest.setPayload(itemsPayload, new RequestMetaDTO());
itemsRequest.setPayload(itemsPayload, REQUEST_META_DTO);
ClassifierItemsResponse response = classifierItemsPublicListener.getClassifierItems(itemsRequest);
assertEquals(0,response.getPayload().size());
assertEquals(0, response.getPayload().size());
}
@Test
......@@ -102,7 +110,7 @@ class ClassifierItemsPublicListenerTest extends ClassifierTestBase {
search.setDefinitionId("COUNY");
search.setItemCode("EE");
itemsPayload.setSearchFilterDto(search);
itemsRequest.setPayload(itemsPayload, new RequestMetaDTO());
itemsRequest.setPayload(itemsPayload, REQUEST_META_DTO);
ClassifierItemsResponse response = classifierItemsPublicListener.getClassifierItems(itemsRequest);
......@@ -114,23 +122,45 @@ class ClassifierItemsPublicListenerTest extends ClassifierTestBase {
search.setDefinitionId(CLASSIFIER_DEFINITION_COUNTRY);
search.setItemCode("EE2");
itemsPayload.setSearchFilterDto(search);
itemsRequest.setPayload(itemsPayload, new RequestMetaDTO());
itemsRequest.setPayload(itemsPayload, REQUEST_META_DTO);
ClassifierItemsResponse response = classifierItemsPublicListener.getClassifierItems(itemsRequest);
assertEquals(0, response.getPayload().size());
}
@Test
void getClassifierItemsDefCodeTest() {
search.setDefinitionId(CLASSIFIER_DEFINITION_COUNTRY);
itemsPayload.setSearchFilterDto(search);
itemsRequest.setPayload(itemsPayload, new RequestMetaDTO());
itemsRequest.setPayload(itemsPayload, REQUEST_META_DTO);
ClassifierItemsResponse defaultValue = classifierItemsPublicListener.getClassifierItems(itemsRequest);
assertThat(252).isEqualTo(defaultValue.getPayload().size());
}
@Test
void getClassifierItems_definitionIdItemCodePartial_success() {
search.setDefinitionId("inspection_topic");
search.setItemCode("*TOPIC_2");
itemsPayload.setSearchFilterDto(search);
itemsRequest.setPayload(itemsPayload, REQUEST_META_DTO);
ClassifierItemsResponse response = classifierItemsPublicListener.getClassifierItems(itemsRequest);
assertThat(response.getPayload().size()).isEqualTo(10);
}
@Test
void getClassifierItems_definitionIdMissing_itemCodeLowerCasePartial_badRequest() {
search.setItemCode("*topic_2");
itemsPayload.setSearchFilterDto(search);
itemsRequest.setPayload(itemsPayload, REQUEST_META_DTO);
ClassifierItemsResponse response = classifierItemsPublicListener.getClassifierItems(itemsRequest);
assertBadRequest(response.getError());
}
}
......@@ -11,8 +11,3 @@ spring:
password: seis
change-log: classpath:/db/changelog/db.changelog-integtest.xml
contexts: integtest
camunda:
bpm:
admin-user:
id: kermit
password: superSecret
......@@ -3,4 +3,3 @@
--changeset raigo:integtest_setup
CREATE USER teis;
CREATE SCHEMA cache;
CREATE SCHEMA camunda;
......@@ -9,13 +9,11 @@ import ee.sm.ti.teis.configuration.QueueConfigurator;
import ee.sm.ti.teis.servicecommon.config.DataSourceConfig;
import ee.sm.ti.teis.servicecommon.config.JpaAuditingConfiguration;
import ee.sm.ti.teis.servicecommon.config.PropertyLogger;
import org.camunda.bpm.spring.boot.starter.annotation.EnableProcessApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
@SpringBootApplication
@EnableProcessApplication
@Import({JpaAuditingConfiguration.class, PropertyLogger.class, ExchangeConfig.class, QueueConfigurator.class,
RabbitListenerAspect.class, DataSourceConfig.class})
public class ClassifierServiceApp {
......
package ee.sm.ti.teis.classifiers.classifier.item.listener;
import ee.sm.ti.teis.classifiers.classifier.item.service.ClassifierItemBusinessService;
import ee.sm.ti.teis.classifiers.rabbit.QueueConfig;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemDto;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemRequest;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemResponse;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemsRequest;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemsResponse;
import ee.sm.ti.teis.commongateway.classifier.*;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import java.util.List;
import static ee.sm.ti.teis.classifiers.rabbit.QueueConfig.GW_CLASSIFIER_ITEMS_QUEUE;
import static ee.sm.ti.teis.classifiers.rabbit.QueueConfig.GW_CLASSIFIER_ITEM_QUEUE;
@Component
@RequiredArgsConstructor
public class ClassifierItemsPublicListener {
private final ClassifierItemBusinessService classifierItemBusinessService;
@RabbitListener(queues = {QueueConfig.GW_CLASSIFIER_ITEM_QUEUE})
@RabbitListener(queues = {GW_CLASSIFIER_ITEM_QUEUE})
public ClassifierItemResponse getClassifierItem(ClassifierItemRequest requestDTO) {
ClassifierItemResponse resultDTO = new ClassifierItemResponse();
ClassifierItemRequest.Parameters payload = requestDTO.getPayload();
......@@ -29,13 +27,13 @@ public class ClassifierItemsPublicListener {
return resultDTO;
}
@RabbitListener(queues = {QueueConfig.GW_CLASSIFIER_ITEMS_QUEUE})
@RabbitListener(queues = {GW_CLASSIFIER_ITEMS_QUEUE})
public ClassifierItemsResponse getClassifierItems(ClassifierItemsRequest request) {
ClassifierItemsResponse response = new ClassifierItemsResponse();
ClassifierItemsRequest.Parameters payload = request.getPayload();
List<ClassifierItemDto> classifierItemDtos =
List<ClassifierItemDto> classifierItemDtoList =
classifierItemBusinessService.getList(payload.getSearchFilterDto());
response.setPayload(classifierItemDtos, request.getRequestMetaDTO());
response.setPayload(classifierItemDtoList, request.getRequestMetaDTO());
return response;
}
......
......@@ -10,7 +10,6 @@ import ee.sm.ti.teis.commongateway.classifier.search.ClassifierItemSearchFilterD
import ee.sm.ti.teis.exceptions.TeisResourceNotFoundException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.querydsl.QSort;
import org.springframework.stereotype.Service;
......@@ -19,7 +18,7 @@ import java.util.List;
import java.util.Optional;
import static ee.sm.ti.teis.types.enums.ObjectStatus.CURRENT;
import static org.apache.commons.lang3.StringUtils.trim;
import static org.apache.commons.lang3.StringUtils.*;
@Service
@Slf4j
......@@ -68,7 +67,7 @@ public class ClassifierItemDataService {
List<ClassifierItemEntity> classifierItems;
List<ClassifierItemEntity> itemsByDefinition;
definition = classifierDefinitionDataService.findById(definitionId);
if (StringUtils.isBlank(itemCode)) {
if (isBlank(itemCode)) {
try {
itemsByDefinition = classifierItemRepository.findAllByClassifierDefinitionIdIgnoreCaseOrderBySeqNoAscNameAsc(definition.getId());
} catch (Exception e) {
......@@ -107,13 +106,18 @@ public class ClassifierItemDataService {
BooleanBuilder where = new BooleanBuilder();
where.and(qClassifierItemEntity.classifierDefinition.id.equalsIgnoreCase(trim(search.getDefinitionId())));
if (StringUtils.isNotEmpty(search.getItemCode())) {
where.and(qClassifierItemEntity.code.equalsIgnoreCase(trim(search.getItemCode())));
if (isNotEmpty(search.getItemCode())) {
String trimmedItemCode = trim(search.getItemCode());
if (trimmedItemCode.startsWith("*")) {
where.and(qClassifierItemEntity.code.likeIgnoreCase(composePartialSearch(trimmedItemCode)));
} else {
where.and(qClassifierItemEntity.code.equalsIgnoreCase(trimmedItemCode));
}
}
if (search.getItemName() != null) {
where.and(qClassifierItemEntity.name.containsIgnoreCase(search.getItemName()));
}
if (StringUtils.isNotEmpty(search.getAttributeCode())) {
if (isNotEmpty(search.getAttributeCode())) {
where.and(qClassifierItemEntity.attributes.any().classifierAttributeDefinition.code.equalsIgnoreCase(trim(search.getAttributeCode())));
where.and(qClassifierItemEntity.attributes.any().value.equalsIgnoreCase(trim(search.getAttributeValue())));
}
......@@ -130,8 +134,6 @@ public class ClassifierItemDataService {
new QSort(qClassifierItemEntity.seqNo.asc(), qClassifierItemEntity.name.asc()));
return classifierItemRepository.findAll(where, defaultSort).getContent();
}
public Long getSeqNoByDefinition(String definitionId) {
......@@ -145,4 +147,10 @@ public class ClassifierItemDataService {
public Long getSeqNumberByClassifierDefinitionAndLevel(String definitionId, Integer level) {
return classifierItemRepository.findSeqNumberByClassifierDefinitionAndLevel(definitionId, level);
}
private String composePartialSearch(String value) {
value = value.replace("*", "");
value = "%" + value + "%";
return value;
}
}
......@@ -28,7 +28,7 @@ public class QueueConfig implements QueueList {
@Override
public void updateQueues(ArrayList<TeisQueue> queues) {
String queueName = "classifier-service" + TestDataImportService.RESET_TEST_DATA_QUEUE_SUFFIX;
String queueName = "classifiers-service" + TestDataImportService.RESET_TEST_DATA_QUEUE_SUFFIX;
addGwQueue(queues, "gwResetTestData", TestDataImportService.RESET_TEST_DATA_ROUTING_KEY, queueName);
addGwQueue(queues, "gwClassifierItemsQueue", ClassifierItemsRequest.ROUTING_KEY, GW_CLASSIFIER_ITEMS_QUEUE);
......
package ee.sm.ti.teis.classifiers.test;
import ee.sm.ti.teis.servicecommon.util.TestDataImportService;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
import static ee.sm.ti.teis.servicecommon.util.TestDataImportService.*;
@Service
@RequiredArgsConstructor
@Profile({"dev", "local", "test"})
public class ResetTestDataListener {
private final TestDataImportService testDataImportService;
@RabbitListener(queues = {"classifier-service" + RESET_TEST_DATA_QUEUE_SUFFIX})
public void resetTestData(String providedMagicString) {
testDataImportService.resetTestData(providedMagicString);
}
}
<process-application
xmlns="http://www.camunda.org/schema/1.0/ProcessApplication">
<process-archive>
<process-engine>default</process-engine>
</process-archive>
</process-application>
\ No newline at end of file
......@@ -2,19 +2,14 @@ spring:
datasource:
url: jdbc:postgresql://localhost:5432/classifiers_service
username: teisdb_user
password: xyz
password: teisdb_user_pwd
liquibase:
user: teisdb_owner
password: xyz
password: teisdb_owner_pwd
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest
camunda:
bpm:
admin-user:
id: kermit
password: superSecret
server:
port: 9000
#server:
# port: 9000