@@ -64,8 +64,8 @@ void cannotOverrideBeanByTypeWithNoSuchBeanType() {
64
64
.isThrownBy (context ::refresh )
65
65
.withMessage ("""
66
66
Unable to override bean: there are no beans of \
67
- type %s (as required by field '%s.example').""" . formatted (
68
- String .class .getName (), FailureByTypeLookup .class .getSimpleName ())) ;
67
+ type %s (as required by field '%s.example').""" ,
68
+ String .class .getName (), FailureByTypeLookup .class .getSimpleName ());
69
69
}
70
70
71
71
@ Test
@@ -87,8 +87,8 @@ void contextCustomizerCannotBeCreatedWithMissingOverrideMethod() {
87
87
assertThatIllegalStateException ()
88
88
.isThrownBy (() -> BeanOverrideContextCustomizerTestUtils .customizeApplicationContext (
89
89
FailureMissingDefaultOverrideMethod .class , context ))
90
- .withMessage ("No static method found named example() or beanToOverride() in %s with return type %s"
91
- . formatted ( FailureMissingDefaultOverrideMethod .class .getName (), String .class .getName () ));
90
+ .withMessage ("No static method found named example() or beanToOverride() in %s with return type %s" ,
91
+ FailureMissingDefaultOverrideMethod .class .getName (), String .class .getName ());
92
92
}
93
93
94
94
@ Test
@@ -97,8 +97,8 @@ void contextCustomizerCannotBeCreatedWithMissingExplicitOverrideMethod() {
97
97
assertThatIllegalStateException ()
98
98
.isThrownBy (() -> BeanOverrideContextCustomizerTestUtils .customizeApplicationContext (
99
99
FailureMissingExplicitOverrideMethod .class , context ))
100
- .withMessage ("No static method found named createExample() in %s with return type %s"
101
- . formatted ( FailureMissingExplicitOverrideMethod .class .getName (), String .class .getName () ));
100
+ .withMessage ("No static method found named createExample() in %s with return type %s" ,
101
+ FailureMissingExplicitOverrideMethod .class .getName (), String .class .getName ());
102
102
}
103
103
104
104
@ Test
@@ -108,8 +108,8 @@ void contextCustomizerCannotBeCreatedWithFieldInParentAndMissingOverrideMethod()
108
108
assertThatIllegalStateException ()
109
109
.isThrownBy (() -> BeanOverrideContextCustomizerTestUtils .customizeApplicationContext (
110
110
FailureOverrideInParentWithoutFactoryMethod .class , context ))
111
- .withMessage ("No static method found named beanToOverride() in %s with return type %s"
112
- . formatted ( FailureOverrideInParentWithoutFactoryMethod .class .getName (), String .class .getName () ));
111
+ .withMessage ("No static method found named beanToOverride() in %s with return type %s" ,
112
+ FailureOverrideInParentWithoutFactoryMethod .class .getName (), String .class .getName ());
113
113
}
114
114
115
115
@ Test
@@ -119,8 +119,8 @@ void contextCustomizerCannotBeCreatedWithCompetingOverrideMethods() {
119
119
assertThatIllegalStateException ()
120
120
.isThrownBy (() -> BeanOverrideContextCustomizerTestUtils .customizeApplicationContext (
121
121
FailureCompetingOverrideMethods .class , context ))
122
- .withMessage ("Found 2 competing static methods named example() or beanToOverride() in %s with return type %s"
123
- . formatted ( FailureCompetingOverrideMethods .class .getName (), String .class .getName () ));
122
+ .withMessage ("Found 2 competing static methods named example() or beanToOverride() in %s with return type %s" ,
123
+ FailureCompetingOverrideMethods .class .getName (), String .class .getName ());
124
124
}
125
125
126
126
@@ -151,7 +151,6 @@ static class FailureMissingDefaultOverrideMethod {
151
151
152
152
// Expected static String example() { ... }
153
153
// or static String beanToOverride() { ... }
154
-
155
154
}
156
155
157
156
static class FailureMissingExplicitOverrideMethod {
@@ -160,20 +159,17 @@ static class FailureMissingExplicitOverrideMethod {
160
159
private String example ;
161
160
162
161
// Expected static String createExample() { ... }
163
-
164
162
}
165
163
166
164
abstract static class AbstractByNameLookup {
167
165
168
166
@ TestBean (methodName = "beanToOverride" )
169
167
protected String beanToOverride ;
170
-
171
168
}
172
169
173
170
static class FailureOverrideInParentWithoutFactoryMethod extends AbstractByNameLookup {
174
171
175
172
// No beanToOverride() method
176
-
177
173
}
178
174
179
175
abstract static class AbstractCompetingMethods {
@@ -191,7 +187,6 @@ static class FailureCompetingOverrideMethods extends AbstractCompetingMethods {
191
187
static String beanToOverride () {
192
188
throw new IllegalStateException ("Should not be called" );
193
189
}
194
-
195
190
}
196
191
197
192
}
0 commit comments