Skip to content

Commit 088d9cc

Browse files
sushant1987mhalbritter
authored andcommitted
Remove mockito-inline from documentation
See gh-37561
1 parent 02f71d8 commit 088d9cc

File tree

1 file changed

+0
-5
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/features

1 file changed

+0
-5
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,6 @@ We recommend using a `@Bean` method to create and configure the mock in this sit
299299
Additionally, you can use `@SpyBean` to wrap any existing bean with a Mockito `spy`.
300300
See the {spring-boot-test-module-api}/mock/mockito/SpyBean.html[Javadoc] for full details.
301301

302-
NOTE: CGLib proxies, such as those created for scoped beans, declare the proxied methods as `final`.
303-
This stops Mockito from functioning correctly as it cannot mock or spy on `final` methods in its default configuration.
304-
If you want to mock or spy on such a bean, configure Mockito to use its inline mock maker by adding `org.mockito:mockito-inline` to your application's test dependencies.
305-
This allows Mockito to mock and spy on `final` methods.
306-
307302
NOTE: While Spring's test framework caches application contexts between tests and reuses a context for tests sharing the same configuration, the use of `@MockBean` or `@SpyBean` influences the cache key, which will most likely increase the number of contexts.
308303

309304
TIP: If you are using `@SpyBean` to spy on a bean with `@Cacheable` methods that refer to parameters by name, your application must be compiled with `-parameters`.

0 commit comments

Comments
 (0)