spring-boot: @ServiceConnection not working as expected

In the process of creating a stream application to test it as a native container I discovered the @ServiceConnection is not working as expected.

I am sharing the repo. https://github.com/corneil/test-processor It contains a Java and Kotlin version of the processor.

The java project contains com.example.testprocessor.testcontainers.TestProcessorServiceConnectionTests that fails with @ServiceConnection There are versions using @EmbeddedKafka and traditional @Testcontainers with @DynamicPropertySource

I also discovered that some tests fail unless forkEvery is 1

Reproduce

./build-test.sh
./build-fail.sh

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

We seem to be going round in circles here. In the hope of breaking of that loop, I’ve opened a PR that should fix the problem in the Kafka stream binder. The changes in the PR update the binder so that it considers any KafkaConnectionDetails bean when making an admin, consumer, or producer connection to Kafka. If any further discussion is needed, let’s have it on the PR, please, as this problem is specific to Spring Cloud Stream. As such, it’s off-topic for most people watching this repository.