refactor: consolidate integration test config into shared application.yaml#108
Open
nozoz wants to merge 4 commits into
Open
refactor: consolidate integration test config into shared application.yaml#108nozoz wants to merge 4 commits into
nozoz wants to merge 4 commits into
Conversation
* feat: kill service on Kafka authorization errors Wrap each consumer's error handler so a TopicAuthorizationException (or any other AuthorizationException) raised from the consumer poll loop hard-halts the JVM, letting the orchestrator restart the pod instead of letting the listener loop log the error indefinitely. * refactor: shut down on Kafka auth failure via ConsumerStoppedEvent Replace the per-consumer ShutdownOnFatalKafkaErrorHandler wrapper with a single @eventlistener on Spring Kafka's ConsumerStoppedEvent (Reason.AUTH). Spring Kafka already classifies fatal AuthorizationExceptions and stops the container, so the cause-walking and per-consumer wiring were duplicating framework behaviour. Exit now goes through SpringApplication.exit() + exitProcess(1) so the context closes cleanly, @PreDestroy runs, and log appenders flush. Switches the exit code from 137 (conventionally 128 + SIGKILL, what k8s reports when it kills the pod) to 1 to avoid misleading pod-termination dashboards. * refactor: drop createLoggingErrorHandler helper The helper was only introduced earlier in this branch to host the shutdown wrapper. With shutdown moved to the ConsumerStoppedEvent listener, it adds no value over calling errorHandlerFactory.createErrorHandler directly with the configuration — restoring the call-site shape used on main.
….yaml
Replace the .allDependencies.each {} workaround in build.gradle with the
idiomatic configurations.extendsFrom pattern so the integrationTest suite
inherits testImplementation/testRuntimeOnly cleanly.
Move every property that was duplicated across integration tests (kafka
bootstrap, default replicas, security flag, org-id, default relation
base-url, auto-offset-reset) into src/integrationTest/resources/application.yaml.
Each integration test now only declares fint.consumer.domain +
fint.consumer.package and whatever truly per-test overrides it needs.
Drop application-utdanning-vurdering.yaml and application-utdanning-elev.yaml
profile files; tests that used @activeprofiles now use @TestPropertySource for
a single explicit place naming domain + package.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
build.gradle: replaced the.allDependencies.each { ... }workaround with the idiomaticconfigurations { integrationTestImplementation.extendsFrom testImplementation; integrationTestRuntimeOnly.extendsFrom testRuntimeOnly }pattern. The integrationTest suite now inherits the same test dependencies through standard Gradle wiring instead of a hand-rolled copy loop.src/integrationTest/resources/application.yaml: lifted every property that was duplicated across integration tests (Kafka bootstrap, default replicas,fint.security.enabled=false,fint.org-id,fint.consumer.org-id, defaultfint.relation.base-url,auto-offset-reset, webflux base path, etc.) into a single shared base. Domain/package are intentionally not set here — each test must declare them.application-utdanning-vurdering.yamlandapplication-utdanning-elev.yaml. Tests that used@ActiveProfilesfor these have been switched to@TestPropertySourceso thefint.consumer.domain+fint.consumer.packagepair is always stated explicitly in the test class itself.@TestPropertySourceis now down to justdomain+package+ any truly per-test overrides (e.g.autorelation.enabled,consume-legacy-resource-topics,event.defaults.eviction, a non-defaultrelation.base-url, a unique consumergroup-id).Verified locally with
./gradlew integrationTest— BUILD SUCCESSFUL.