diff --git a/application-local.yml b/application-local.yml new file mode 100644 index 0000000..7dbc39f --- /dev/null +++ b/application-local.yml @@ -0,0 +1,21 @@ +server: + port: 8081 + +spring: + activemq: + broker-url: tcp://localhost:61616 + user: admin + password: admin + +backbase: + event-emitter: + #comma-separated list topic names + topic-names: com.backbase.dbs.messages.pandp.event.spec.v4.MessageReceivedEvent + +logging: + level: + com: + backbase: DEBUG + org: + springframework: + cloud: DEBUG diff --git a/pom.xml b/pom.xml index bb94069..55be3f7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,16 +5,17 @@ com.backbase.buildingblocks service-sdk-starter-core - 15.1.0 + 16.1.5 com.backbase.testing event-emitter - 1.6.1-SNAPSHOT - war + 1.7.0-SNAPSHOT + jar Backbase :: Testing Components :: Events Emitter + true 1.1.5 @@ -25,7 +26,7 @@ 1.3.92 2.0.6 0.5 - 1.0.47 + 7.0.0 17 ${project.build.directory}/downloaded-api @@ -42,10 +43,12 @@ 1.9.4 2.0.7 2.6.0 - 0.14.0 - 1.6.2 + 0.17.20 + 2.2.15 0.2.1 2.0.0 + 1.17.6 + 0.2.0 target/coverage-reports/jacoco.exec,target/coverage-reports/jacoco-it.exec src/main/java,pom.xml @@ -64,7 +67,7 @@ org.testcontainers testcontainers-bom - 1.17.5 + ${testcontainers.version} pom import @@ -76,6 +79,10 @@ com.backbase.buildingblocks events + + com.backbase.buildingblocks + spring-cloud-stream-binder-jms-activemq + com.backbase.buildingblocks api @@ -121,9 +128,9 @@ guava - io.swagger + io.swagger.core.v3 swagger-annotations - ${swagger-annotations.version} + ${swagger-core-annotations.version} org.openapitools @@ -148,6 +155,10 @@ mapstruct-processor ${mapstruct.version} + + jakarta.annotation + jakarta.annotation-api + org.springframework.boot spring-boot-starter-test @@ -160,7 +171,6 @@ org.junit.jupiter junit-jupiter - 5.8.1 test @@ -220,6 +230,11 @@ service-sdk-starter-mapping ${project.parent.version} + + org.projectlombok + lombok-mapstruct-binding + ${lombok-mapstruct-binding.version} + -Amapstruct.unmappedTargetPolicy=ERROR @@ -319,9 +334,11 @@ com.backbase.dbs.audit audit-spec - jar - ${audit-spec-version} - target/unpacked-specs/audit-spec + ${audit-spec.version} + zip + events + true + ${project.build.directory}/unpacked-specs/audit-spec/events @@ -437,16 +454,17 @@ - audit-events + audit-spec generate-sources events-generation + target/unpacked-specs/audit-spec/events/ target/generated-sources/ - target/unpacked-specs/audit-spec/events - audit.persistence 1 + audit.persistence + APP_NAME diff --git a/src/main/java/com/backbase/eo/testing/events/emitter/EventEmittingController.java b/src/main/java/com/backbase/eo/testing/events/emitter/EventEmittingController.java index c27561c..b7f61b4 100644 --- a/src/main/java/com/backbase/eo/testing/events/emitter/EventEmittingController.java +++ b/src/main/java/com/backbase/eo/testing/events/emitter/EventEmittingController.java @@ -1,7 +1,7 @@ package com.backbase.eo.testing.events.emitter; import com.backbase.buildingblocks.backend.communication.context.OriginatorContext; -import com.backbase.buildingblocks.backend.communication.event.EnvelopedEvent; +import com.backbase.buildingblocks.backend.communication.event.EnvelopedEvent; import com.backbase.buildingblocks.backend.communication.event.proxy.EventBus; import com.backbase.buildingblocks.persistence.model.Event; import com.backbase.buildingblocks.presentation.errors.BadRequestException; @@ -19,7 +19,7 @@ import java.util.Set; import java.util.UUID; import java.util.concurrent.TimeUnit; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import lombok.RequiredArgsConstructor; import org.reflections.Reflections; diff --git a/src/main/java/com/backbase/eo/testing/events/emitter/RawEmittingController.java b/src/main/java/com/backbase/eo/testing/events/emitter/RawEmittingController.java index a299799..73fcbb7 100644 --- a/src/main/java/com/backbase/eo/testing/events/emitter/RawEmittingController.java +++ b/src/main/java/com/backbase/eo/testing/events/emitter/RawEmittingController.java @@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import java.time.Instant; import java.util.Collections; import java.util.List; diff --git a/src/test/java/com/backbase/eo/testing/events/emitter/EventEmitterIT.java b/src/test/java/com/backbase/eo/testing/events/emitter/EventEmitterIT.java index e9ce990..c5c6b91 100644 --- a/src/test/java/com/backbase/eo/testing/events/emitter/EventEmitterIT.java +++ b/src/test/java/com/backbase/eo/testing/events/emitter/EventEmitterIT.java @@ -11,6 +11,7 @@ import com.backbase.eo.testing.events.EventEmitter; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectWriter; +import lombok.extern.slf4j.Slf4j; import org.junit.ClassRule; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; @@ -35,6 +36,7 @@ import java.util.Collections; import java.util.Map; import java.util.UUID; +import org.testcontainers.containers.output.Slf4jLogConsumer; /** * {@link EventEmitterIT} @@ -49,6 +51,7 @@ @ActiveProfiles({"default", "it"}) @SpringBootTest(classes = {EventEmitter.class, TestEventConsumerConfiguration.class}) @ContextConfiguration(classes = {EventEmitter.class, TestEventConsumerConfiguration.class}, initializers = {EventEmitterIT.Initializer.class}) +@Slf4j class EventEmitterIT { @Autowired @@ -62,7 +65,8 @@ class EventEmitterIT { @ClassRule public static DockerComposeContainer environment = new DockerComposeContainer( new File("src/test/resources/docker-compose.yml")) - .withExposedService("message-broker", 61616); + .withExposedService("message-broker", 61616) + .withLogConsumer("message-broker", new Slf4jLogConsumer(log)); @BeforeAll public static void envSetup() { @@ -82,7 +86,7 @@ public void initialize(ConfigurableApplicationContext configurableApplicationCon "spring.event-emitter.topic-names=" + EVENT_DESTINATION, "spring.cloud.stream.bindings.consumeTestEvent-in-0.group=event-emitter", "spring.cloud.stream.bindings.consumeTestEvent-in-0.destination=" + EVENT_DESTINATION, - "spring.cloud.stream.function.definition=consumeTestEvent", + "spring.cloud.function.definition=consumeTestEvent", "backbase.event-emitter.custom-header-pairs[0].http=x-lob", "backbase.event-emitter.custom-header-pairs[0].event=bbLineOfBusiness", "backbase.event-emitter.custom-header-pairs[1].http=customerCategory", diff --git a/src/test/resources/application-it.yml b/src/test/resources/application-it.yml new file mode 100644 index 0000000..da1cb9b --- /dev/null +++ b/src/test/resources/application-it.yml @@ -0,0 +1,9 @@ +spring: + main: + cloud-platform: NONE + +logging: + level: + root: INFO + com: + backbase: DEBUG