-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
In what version(s) of Spring for Apache Kafka are you seeing this issue?
2.7.2 (maybe All)
Describe the bug
when used with @nested, Multiple Contexts appear causing test to break.
Contexts caching miss.
To Reproduce
�this following situations are likely to cause problems.
@EmbeddedKafka
@SpringBootTest
class BeanTwiceTest {
@Nested
class NestedClass {
@Test
void test() {
}
}
}
As a result, errors may occur when using libraries such as WireMock, Restdocs, and contexts may not be reused as intended. (Mockito.verify(instance, times()) fails, etc.)
Expected behavior
Context should appear only once. (Caching must be successful.)
Sample
below is an example of only the test in the Nested Class being broken. (but. After modified)
The contents are summarized below.