Revert polish on Bean Override support
This commit revers the removal of the `private` keyword in the examples of the reference documentation and the tests for consistency. While the default visibility makes the example more concise, it could imply to the reader that the field (or the factory method) cannot be private. Also, there is no need to multiply anything returned from `Objects.hash` as its very distinct on its own already.
This commit is contained in:
@@ -43,7 +43,7 @@ Java::
|
||||
----
|
||||
class OverrideBeanTests {
|
||||
@MockitoBean // <1>
|
||||
CustomService customService;
|
||||
private CustomService customService;
|
||||
|
||||
// test case body...
|
||||
}
|
||||
@@ -67,7 +67,7 @@ Java::
|
||||
----
|
||||
class OverrideBeanTests {
|
||||
@MockitoBean(name = "service") // <1>
|
||||
CustomService customService;
|
||||
private CustomService customService;
|
||||
|
||||
// test case body...
|
||||
|
||||
@@ -88,7 +88,7 @@ Java::
|
||||
----
|
||||
class OverrideBeanTests {
|
||||
@MockitoSpyBean // <1>
|
||||
CustomService customService;
|
||||
private CustomService customService;
|
||||
|
||||
// test case body...
|
||||
}
|
||||
@@ -111,7 +111,7 @@ Java::
|
||||
----
|
||||
class OverrideBeanTests {
|
||||
@MockitoSpyBean(name = "service") // <1>
|
||||
CustomService customService;
|
||||
private CustomService customService;
|
||||
|
||||
// test case body...
|
||||
|
||||
|
||||
@@ -36,11 +36,11 @@ Java::
|
||||
----
|
||||
class OverrideBeanTests {
|
||||
@TestBean // <1>
|
||||
CustomService customService;
|
||||
private CustomService customService;
|
||||
|
||||
// test case body...
|
||||
|
||||
static CustomService customService() { // <2>
|
||||
private static CustomService customService() { // <2>
|
||||
return new MyFakeCustomService();
|
||||
}
|
||||
}
|
||||
@@ -64,11 +64,11 @@ Java::
|
||||
----
|
||||
class OverrideBeanTests {
|
||||
@TestBean(name = "service", methodName = "createCustomService") // <1>
|
||||
CustomService customService;
|
||||
private CustomService customService;
|
||||
|
||||
// test case body...
|
||||
|
||||
static CustomService createCustomService() { // <2>
|
||||
private static CustomService createCustomService() { // <2>
|
||||
return new MyFakeCustomService();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user