ewolff / microservice-kafka

Demo to show how Apache Kafka can be used for communication between microservices
Apache License 2.0
585 stars 302 forks source link

KafkaTemplate falling back on defaults, breaking build. #7

Closed thabach closed 6 years ago

thabach commented 6 years ago

The KafkaTemplate in ShipmentKafkaTest::orderAreReceived gets its template set to localhost:9092 as bootstrap.servers on a shipping module or top-level (the project’s multi-module) Maven build.

This pull request adds @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) annotations to all tests in micro service-kafka-shipping to make all tests pass nicely.

ewolff commented 6 years ago

Thanks a lot! I used a slightly different approach in e8ec7dfea1f518131bb52158b4fcc2033f8c10a0 - it dirties the context before the test so that the test with the embedded Kafka get a new context that is set up correctly while the other tests use the original context. I added that code to the other Kafka-based tests, too. Let me know what you think!

thabach commented 6 years ago

I can dig it ;-)