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
Stop using a conventional suffix for TestBean factory methods
This commit changes how factory method for `@TestBean` usage is
discovered. Previously the field name or bean name suffixed with
'TestOverride' was used. It sounds more natural to just use the
field name or bean name, leaving cases where a suffix is required
to explicitly providing the method name.
As part of this change, the exception messages have been revisited as
it's less since the method name candidates have the exact same name
as the field or bean name. A `()` is added to make it more clear the
name is for a method.
Closesgh-32940
Copy file name to clipboardexpand all lines: spring-test/src/main/java/org/springframework/test/context/bean/override/convention/TestBeanOverrideProcessor.java
Copy file name to clipboardexpand all lines: spring-test/src/test/java/org/springframework/test/context/bean/override/convention/AbstractTestBeanIntegrationTestCase.java
+2-2
Original file line number
Diff line number
Diff line change
@@ -32,11 +32,11 @@ abstract class AbstractTestBeanIntegrationTestCase {
Copy file name to clipboardexpand all lines: spring-test/src/test/java/org/springframework/test/context/bean/override/convention/FailingTestBeanByTypeIntegrationTests.java
+2-2
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ static class NoMatchingBeansTestCase {
80
80
voidtest() {
81
81
}
82
82
83
-
staticExampleServiceexampleTestOverride() {
83
+
staticExampleServiceexample() {
84
84
returnfail("unexpected override");
85
85
}
86
86
@@ -100,7 +100,7 @@ static class TooManyBeansTestCase {
Copy file name to clipboardexpand all lines: spring-test/src/test/java/org/springframework/test/context/bean/override/convention/FailingTestBeanInheritanceIntegrationTests.java
Copy file name to clipboardexpand all lines: spring-test/src/test/java/org/springframework/test/context/bean/override/convention/FailingTestBeanIntegrationTests.java
Copy file name to clipboardexpand all lines: spring-test/src/test/java/org/springframework/test/context/bean/override/convention/TestBeanByTypeIntegrationTests.java
+1-1
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ public class TestBeanByTypeIntegrationTests {
0 commit comments