-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: #85 Fix Kafka interceptor without Spring and add a consumer int…
…erceptor
- Loading branch information
1 parent
164c1ab
commit 2d9b9a7
Showing
36 changed files
with
1,269 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
jacocoTestReport { | ||
reports { | ||
xml.enabled(true) | ||
html.enabled(true) | ||
html.destination(project.provider(() -> new File("${project.buildDir}/reports/coverage"))) | ||
xml.required = true | ||
html.required = true | ||
html.getOutputLocation().set( new File("${project.layout.buildDirectory}/reports/coverage")) | ||
} | ||
executionData( | ||
file("${project.buildDir}/jacoco/test.exec"), | ||
file("${project.buildDir}/jacoco/integrationMongoTest.exec"), | ||
file("${project.buildDir}/jacoco/integrationHttpTest.exec") | ||
file("${project.layout.buildDirectory}/jacoco/test.exec"), | ||
file("${project.layout.buildDirectory}/jacoco/integrationMongoTest.exec"), | ||
file("${project.layout.buildDirectory}/jacoco/integrationHttpTest.exec") | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
jacocoTestReport { | ||
reports { | ||
xml.enabled(true) | ||
html.enabled(true) | ||
html.destination(project.provider(() -> new File("${project.buildDir}/reports/coverage"))) | ||
xml.required = true | ||
html.required = true | ||
html.getOutputLocation().set( new File("${project.layout.buildDirectory}/reports/coverage")) | ||
} | ||
executionData( | ||
file("${project.buildDir}/jacoco/test.exec"), | ||
file("${project.buildDir}/jacoco/integrationMongoTest.exec"), | ||
file("${project.buildDir}/jacoco/integrationHttpTest.exec") | ||
file("${project.layout.buildDirectory}/jacoco/test.exec"), | ||
file("${project.layout.buildDirectory}/jacoco/integrationMongoTest.exec"), | ||
file("${project.layout.buildDirectory}/jacoco/integrationHttpTest.exec") | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
jacocoTestReport { | ||
reports { | ||
xml.enabled(true) | ||
html.enabled(true) | ||
html.destination(project.provider(() -> new File("${project.buildDir}/reports/coverage"))) | ||
xml.required = true | ||
html.required = true | ||
html.getOutputLocation().set( new File("${project.layout.buildDirectory}/reports/coverage")) | ||
} | ||
executionData( | ||
file("${project.buildDir}/jacoco/test.exec"), | ||
file("${project.buildDir}/jacoco/integrationMongoTest.exec"), | ||
file("${project.buildDir}/jacoco/integrationHttpTest.exec") | ||
file("${project.layout.buildDirectory}/jacoco/test.exec"), | ||
file("${project.layout.buildDirectory}/jacoco/integrationMongoTest.exec"), | ||
file("${project.layout.buildDirectory}/jacoco/integrationHttpTest.exec") | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
services: | ||
zookeeper: | ||
image: confluentinc/cp-zookeeper:7.2.1 | ||
hostname: zookeeper | ||
container_name: zookeeper | ||
ports: | ||
- "2181:2181" | ||
environment: | ||
ZOOKEEPER_CLIENT_PORT: 2181 | ||
ZOOKEEPER_TICK_TIME: 2000 | ||
kafka: | ||
image: confluentinc/cp-kafka:7.2.1 | ||
hostname: kafka | ||
container_name: kafka | ||
depends_on: | ||
- zookeeper | ||
ports: | ||
- "9092:9092" | ||
environment: | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 | ||
KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_CONFLUENT_BALANCER_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 | ||
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 | ||
KAFKA_CONFLUENT_SCHEMA_REGISTRY_URL: http://schema-registry:8081 | ||
kafka-ui: | ||
container_name: kafka-ui | ||
image: provectuslabs/kafka-ui:latest | ||
ports: | ||
- 8888:8080 | ||
environment: | ||
DYNAMIC_CONFIG_ENABLED: true | ||
KAFKA_CLUSTERS_0_NAME: spring_kafka_test | ||
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092 | ||
volumes: | ||
- ./kui/config.yml:/etc/kafkaui/dynamic_config.yaml | ||
healthy: | ||
image: busybox | ||
restart: "no" | ||
container_name: health_checker | ||
depends_on: | ||
zookeeper: | ||
condition: service_started | ||
kafka: | ||
condition: service_started | ||
kafka-ui: | ||
condition: service_started |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
sourceSets { | ||
integrationHttpTest { | ||
java { | ||
compileClasspath += main.output | ||
runtimeClasspath += main.output | ||
srcDir file('src/integrationHttpTest/java') | ||
} | ||
} | ||
} | ||
|
||
configurations { | ||
integrationHttpTestImplementation.extendsFrom implementation | ||
} | ||
|
||
dependencies { | ||
|
||
// Spring | ||
integrationHttpTestImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
integrationHttpTestImplementation 'org.springframework.cloud:spring-cloud-starter-sleuth' | ||
integrationHttpTestImplementation 'org.springframework.boot:spring-boot-starter-web' | ||
integrationHttpTestImplementation 'org.springframework.kafka:spring-kafka' | ||
integrationHttpTestImplementation 'org.springframework.kafka:spring-kafka-test' | ||
|
||
// Other | ||
integrationHttpTestImplementation 'org.awaitility:awaitility:4.1.0' | ||
integrationHttpTestImplementation 'com.github.tomakehurst:wiremock-jre8:2.35.0' | ||
integrationHttpTestImplementation 'org.jeasy:easy-random-core:5.0.0' | ||
|
||
// LSD | ||
integrationHttpTestImplementation 'io.github.lsd-consulting:lsd-distributed-http-connector:3.0.1' | ||
integrationHttpTestImplementation('io.github.lsd-consulting:lsd-distributed-generator-ui-service:6.0.2:wiremock-stubs'){ | ||
exclude group: "*", module: "*" | ||
} | ||
|
||
integrationHttpTestImplementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.1' | ||
|
||
// integrationHttpTestImplementation 'ch.qos.logback:logback-core:1.5.6' | ||
// integrationHttpTestImplementation 'ch.qos.logback:logback-classic:1.5.6' | ||
// integrationHttpTestImplementation 'org.slf4j:slf4j-api:2.0.16' | ||
} | ||
|
||
tasks.register('integrationHttpTest', Test) { | ||
useJUnitPlatform() | ||
dependsOn assemble | ||
|
||
testClassesDirs = sourceSets.integrationHttpTest.output.classesDirs | ||
classpath = sourceSets.integrationHttpTest.runtimeClasspath | ||
outputs.upToDateWhen { false } | ||
testLogging.showStandardStreams = false | ||
mustRunAfter(test) | ||
finalizedBy jacocoTestReport | ||
} | ||
|
||
check.dependsOn(integrationHttpTest) | ||
|
||
integrationHttpTest { | ||
afterSuite { desc, result -> | ||
if (!desc.parent) { | ||
println "Http integration test results: (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)" | ||
if (result.testCount == 0) { | ||
throw new IllegalStateException("No tests were found. Failing the build") | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
jacocoTestReport { | ||
reports { | ||
xml.enabled(true) | ||
html.enabled(true) | ||
html.destination(project.provider(() -> new File("${project.buildDir}/reports/coverage"))) | ||
xml.required = true | ||
html.required = true | ||
html.getOutputLocation().set( new File("${project.layout.buildDirectory}/reports/coverage")) | ||
} | ||
executionData( | ||
file("${project.buildDir}/jacoco/test.exec") | ||
file("${project.layout.buildDirectory}/jacoco/test.exec"), | ||
file("${project.layout.buildDirectory}/jacoco/integrationHttpTest.exec"), | ||
file("${project.layout.buildDirectory}/jacoco/springIntegrationHttpTest.exec") | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
sourceSets { | ||
springIntegrationHttpTest { | ||
java { | ||
compileClasspath += main.output | ||
runtimeClasspath += main.output | ||
srcDir file('src/springIntegrationHttpTest/java') | ||
} | ||
} | ||
} | ||
|
||
configurations { | ||
springIntegrationHttpTestImplementation.extendsFrom implementation | ||
} | ||
|
||
dependencies { | ||
|
||
// Spring | ||
springIntegrationHttpTestImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
springIntegrationHttpTestImplementation 'org.springframework.cloud:spring-cloud-starter-sleuth' | ||
springIntegrationHttpTestImplementation 'org.springframework.boot:spring-boot-starter-web' | ||
springIntegrationHttpTestImplementation 'org.springframework.kafka:spring-kafka' | ||
springIntegrationHttpTestImplementation 'org.springframework.kafka:spring-kafka-test' | ||
|
||
// Other | ||
springIntegrationHttpTestImplementation 'org.awaitility:awaitility:4.1.0' | ||
springIntegrationHttpTestImplementation 'com.github.tomakehurst:wiremock-jre8:2.35.0' | ||
springIntegrationHttpTestImplementation 'org.jeasy:easy-random-core:5.0.0' | ||
|
||
// LSD | ||
springIntegrationHttpTestImplementation 'io.github.lsd-consulting:lsd-distributed-http-connector:3.0.1' | ||
springIntegrationHttpTestImplementation('io.github.lsd-consulting:lsd-distributed-generator-ui-service:6.0.2:wiremock-stubs'){ | ||
exclude group: "*", module: "*" | ||
} | ||
|
||
springIntegrationHttpTestImplementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.1' | ||
|
||
// springIntegrationHttpTestImplementation 'ch.qos.logback:logback-core:1.5.6' | ||
// springIntegrationHttpTestImplementation 'ch.qos.logback:logback-classic:1.5.6' | ||
// springIntegrationHttpTestImplementation 'org.slf4j:slf4j-api:2.0.16' | ||
} | ||
|
||
tasks.register('springIntegrationHttpTest', Test) { | ||
useJUnitPlatform() | ||
dependsOn assemble | ||
|
||
testClassesDirs = sourceSets.springIntegrationHttpTest.output.classesDirs | ||
classpath = sourceSets.springIntegrationHttpTest.runtimeClasspath | ||
outputs.upToDateWhen { false } | ||
testLogging.showStandardStreams = false | ||
mustRunAfter(test) | ||
finalizedBy jacocoTestReport | ||
} | ||
|
||
check.dependsOn(springIntegrationHttpTest) | ||
|
||
springIntegrationHttpTest { | ||
afterSuite { desc, result -> | ||
if (!desc.parent) { | ||
println "Http integration test results: (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)" | ||
if (result.testCount == 0) { | ||
throw new IllegalStateException("No tests were found. Failing the build") | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.