Browse Source

Add clarifying Note for limitation issue #35906

Signed-off-by: albonidrizi <albonidrizi@gmail.com>
pull/36006/head
albonidrizi 6 days ago
parent
commit
50452a57aa
  1. 5
      framework-docs/modules/ROOT/pages/testing/testcontext-framework/fixture-di.adoc

5
framework-docs/modules/ROOT/pages/testing/testcontext-framework/fixture-di.adoc

@ -35,6 +35,11 @@ dependency injection altogether by explicitly configuring your class with @@ -35,6 +35,11 @@ dependency injection altogether by explicitly configuring your class with
`@TestExecutionListeners` and omitting `DependencyInjectionTestExecutionListener.class`
from the list of listeners.
[NOTE]
====
If you are using Spring Boot's `@LocalServerPort` annotation in tests, be aware that it may not be injected correctly when using nested test classes with inheritance (see https://github.com/spring-projects/spring-framework/issues/35906[gh-35906]).
====
Consider the scenario of testing a `HibernateTitleRepository` class, as outlined in the
xref:testing/integration.adoc#integration-testing-goals[Goals] section. The next two code
listings demonstrate the use of `@Autowired` on fields and setter methods. The application

Loading…
Cancel
Save