You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2019 the original author or authors.
2
+
* Copyright 2012-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -36,10 +36,12 @@
36
36
* used as a class level annotation or on fields in either {@code @Configuration} classes,
37
37
* or test classes that are {@link RunWith @RunWith} the {@link SpringRunner}.
38
38
* <p>
39
-
* Mocks can be registered by type or by {@link #name() bean name}. Any existing single
40
-
* bean of the same type defined in the context will be replaced by the mock. If no
41
-
* existing bean is defined a new one will be added. Dependencies that are known to the
42
-
* application context but are not beans (such as those
39
+
* Mocks can be registered by type or by {@link #name() bean name}. When registered by
40
+
* type, any existing single bean of a matching type (including subclasses) in the context
41
+
* will be replaced by the mock. When registered by name, an existing bean can be
42
+
* specifically targeted for replacement by a mock. In either case, if no existing bean is
43
+
* defined a new one will be added. Dependencies that are known to the application context
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/SpyBean.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2019 the original author or authors.
2
+
* Copyright 2012-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -37,9 +37,9 @@
37
37
* {@link RunWith @RunWith} the {@link SpringRunner}.
38
38
* <p>
39
39
* Spies can be applied by type or by {@link #name() bean name}. All beans in the context
40
-
* of the same type will be wrapped with the spy. If no existing bean is defined a new one
41
-
* will be added. Dependencies that are known to the application context but are not beans
42
-
* (such as those
40
+
* of a matching type (including subclasses) will be wrapped with the spy. If no existing
41
+
* bean is defined a new one will be added. Dependencies that are known to the application
0 commit comments