Skip to content

Commit bbcc269

Browse files
committed
Polish
1 parent c09eb63 commit bbcc269

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

spring-beans/src/test/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragmentsTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ void getTargetOnConstructorToProtectedFactoryBean() {
6868
@Test
6969
void getTargetOnMethod() {
7070
RegisteredBean registeredBean = registerTestBean(SimpleBean.class);
71-
Method method = ReflectionUtils.findMethod(SimpleBeanFactoryBean.class, "getObject");
71+
Method method = ReflectionUtils.findMethod(SimpleBeanConfiguration.class, "simpleBean");
7272
assertThat(method).isNotNull();
7373
assertThat(createInstance(registeredBean).getTarget(registeredBean,
74-
method)).isEqualTo(SimpleBeanFactoryBean.class);
74+
method)).isEqualTo(SimpleBeanConfiguration.class);
7575
}
7676

7777
@Test
@@ -107,9 +107,10 @@ void getTargetOnMethodWithInnerBeanInRegularPackage() {
107107
RegisteredBean registeredBean = registerTestBean(DummyFactory.class);
108108
RegisteredBean innerBean = RegisteredBean.ofInnerBean(registeredBean, "innerTestBean",
109109
new RootBeanDefinition(SimpleBean.class));
110-
Method method = ReflectionUtils.findMethod(SimpleBeanFactoryBean.class, "getObject");
110+
Method method = ReflectionUtils.findMethod(SimpleBeanConfiguration.class, "simpleBean");
111111
assertThat(method).isNotNull();
112-
assertThat(createInstance(innerBean).getTarget(innerBean, method)).isEqualTo(SimpleBeanFactoryBean.class);
112+
assertThat(createInstance(innerBean).getTarget(innerBean, method))
113+
.isEqualTo(SimpleBeanConfiguration.class);
113114
}
114115

115116
@Test
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright 2002-2022 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.beans.factory.aot;
18+
19+
/**
20+
*
21+
* @author Stephane Nicoll
22+
*/
23+
public class SimpleBeanConfiguration {
24+
25+
public SimpleBean simpleBean() {
26+
return new SimpleBean();
27+
}
28+
29+
}

0 commit comments

Comments
 (0)