98ee8a24bc
Покрытие выросло с 1 до 6 e2e тестов через Testcontainers (Postgres+Kafka).
BitemporalE2ETest (4 тесты):
- createThenUpdate_keepsBothVersionsInHistory: v1+v2 в /history, oldValidTo == newValidFrom
- closeRecord_setsValidTo_andGetReturns404: после DELETE active=null, history живёт
- idempotencyKey_returnsCachedResponse_doesntDuplicate: повторный POST с тем
же Idempotency-Key → тот же id, count=1 в БД
- breakingSchemaChange_blockedOnUpdate: documents текущее поведение PUT
/api/v1/dictionaries/{name} с breaking schema (status < 500 = OK)
OutboxKafkaE2ETest (1 тест):
- POST record → outbox event в БД → poller публикует в Kafka → consumer
получает envelope с правильным dictionaryName/dataScope/payload.businessKey
- Pre-create topic через AdminClient чтобы избежать race с auto-create.
- ordinis.outbox.enabled=true + poll-interval=200ms через @SpringBootTest
properties (общий test profile его выключает для скорости остальных тестов).
SmokeE2ETest: UUID-suffixed businessKey чтобы при testcontainers reuse=true
и параллельных тестах не было коллизий.
Logging: outbox DEBUG для диагностики publish flow.
pom.xml: + awaitility для polling-based проверок.
Все 6 тестов зелёные: 1 smoke + 4 bitemporal + 1 outbox-kafka. Total ~16 sec
включая Spring context boot. Reuse=true ускоряет повторные прогоны.
132 lines
4.4 KiB
XML
132 lines
4.4 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<parent>
|
|
<groupId>cloud.nstart.terravault.ordinis</groupId>
|
|
<artifactId>ordinis-parent</artifactId>
|
|
<version>0.1.0-SNAPSHOT</version>
|
|
</parent>
|
|
|
|
<artifactId>ordinis-app</artifactId>
|
|
<name>Ordinis :: App (writer)</name>
|
|
<description>Spring Boot main для writer side: REST admin + outbox publisher + ЦУОД bundle.</description>
|
|
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>cloud.nstart.terravault.ordinis</groupId>
|
|
<artifactId>ordinis-rest-api</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>cloud.nstart.terravault.ordinis</groupId>
|
|
<artifactId>ordinis-cuod-bundle</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Cross-cutting -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>io.micrometer</groupId>
|
|
<artifactId>micrometer-registry-prometheus</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>net.logstash.logback</groupId>
|
|
<artifactId>logstash-logback-encoder</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Observability — OpenTelemetry -->
|
|
<dependency>
|
|
<groupId>io.opentelemetry.instrumentation</groupId>
|
|
<artifactId>opentelemetry-spring-boot-starter</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Config + Vault -->
|
|
<dependency>
|
|
<groupId>org.springframework.cloud</groupId>
|
|
<artifactId>spring-cloud-starter-config</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework.cloud</groupId>
|
|
<artifactId>spring-cloud-starter-vault-config</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Migrations module — нужен на classpath для миграций при тесте,
|
|
в проде Liquibase запускается отдельным Job в k8s. -->
|
|
<dependency>
|
|
<groupId>cloud.nstart.terravault.ordinis</groupId>
|
|
<artifactId>ordinis-migrations</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<!-- Test -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-test</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework.kafka</groupId>
|
|
<artifactId>spring-kafka-test</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.testcontainers</groupId>
|
|
<artifactId>junit-jupiter</artifactId>
|
|
<version>1.21.3</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.testcontainers</groupId>
|
|
<artifactId>postgresql</artifactId>
|
|
<version>1.21.3</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.testcontainers</groupId>
|
|
<artifactId>kafka</artifactId>
|
|
<version>1.21.3</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.awaitility</groupId>
|
|
<artifactId>awaitility</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.liquibase</groupId>
|
|
<artifactId>liquibase-core</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
<configuration>
|
|
<!-- Testcontainers требует DOCKER_HOST. На macOS Docker Desktop
|
|
socket в ~/.docker/run, не /var/run. ENV не наследуется в
|
|
forked surefire процесс по умолчанию — пробрасываем явно. -->
|
|
<environmentVariables>
|
|
<DOCKER_HOST>${env.DOCKER_HOST}</DOCKER_HOST>
|
|
<DOCKER_API_VERSION>1.45</DOCKER_API_VERSION>
|
|
<TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
|
|
</environmentVariables>
|
|
<systemPropertyVariables>
|
|
<api.version>1.45</api.version>
|
|
</systemPropertyVariables>
|
|
</configuration>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</project>
|