Skip to content

Commit

Permalink
doc: report commit "Clarify type matching performed by MockBean and S…
Browse files Browse the repository at this point in the history
…pyBean"

This reports the commit spring-projects/spring-boot@e927cd7
  • Loading branch information
jnizet committed Mar 25, 2022
1 parent dd2f832 commit 3fcb36b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/main/java/com/ninjasquad/springmockk/MockkBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
* used as a class level annotation or on fields in either {@code @Configuration} classes,
* or test classes that are run with the {@link SpringRunner}.
* <p>
* Mocks can be registered by type or by {@link #name() bean name}. Any existing single
* bean of the same type defined in the context will be replaced by the mock. If no
* existing bean is defined a new one will be added. Dependencies that are known to the
* application context but are not beans (such as those
* Mocks can be registered by type or by {@link #name() bean name}. When registered by
* type, any existing single bean of a matching type (including subclasses) in the context
* will be replaced by the mock. When registered by name, an existing bean can be
* specifically targeted for replacement by a mock. In either case, if no existing bean is
* defined a new one will be added. Dependencies that are known to the application context
* but are not beans (such as those
* {@link org.springframework.beans.factory.config.ConfigurableListableBeanFactory#registerResolvableDependency(Class, Object)
* registered directly}) will not be found and a mocked bean will be added to the context
* alongside the existing dependency.
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/ninjasquad/springmockk/SpykBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* run with the {@link SpringRunner}.
* <p>
* Spies can be applied by type or by {@link #name() bean name}. All beans in the context
* of the same type will be wrapped with the spy. If no existing bean is defined a new one
* will be added. Dependencies that are known to the application context but are not beans
* (such as those
* of a matching type (including subclasses) will be wrapped with the spy. If no existing
* bean is defined a new one will be added. Dependencies that are known to the application
* context but are not beans (such as those
* {@link org.springframework.beans.factory.config.ConfigurableListableBeanFactory#registerResolvableDependency(Class, Object)
* registered directly}) will not be found and a spied bean will be added to the context
* alongside the existing dependency.
Expand Down

0 comments on commit 3fcb36b

Please sign in to comment.