diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragmentsTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragmentsTests.java index 782afd3aa1b..35abd77c1e8 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragmentsTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragmentsTests.java @@ -68,10 +68,10 @@ class DefaultBeanRegistrationCodeFragmentsTests { @Test void getTargetOnMethod() { RegisteredBean registeredBean = registerTestBean(SimpleBean.class); - Method method = ReflectionUtils.findMethod(SimpleBeanFactoryBean.class, "getObject"); + Method method = ReflectionUtils.findMethod(SimpleBeanConfiguration.class, "simpleBean"); assertThat(method).isNotNull(); assertThat(createInstance(registeredBean).getTarget(registeredBean, - method)).isEqualTo(SimpleBeanFactoryBean.class); + method)).isEqualTo(SimpleBeanConfiguration.class); } @Test @@ -107,9 +107,10 @@ class DefaultBeanRegistrationCodeFragmentsTests { RegisteredBean registeredBean = registerTestBean(DummyFactory.class); RegisteredBean innerBean = RegisteredBean.ofInnerBean(registeredBean, "innerTestBean", new RootBeanDefinition(SimpleBean.class)); - Method method = ReflectionUtils.findMethod(SimpleBeanFactoryBean.class, "getObject"); + Method method = ReflectionUtils.findMethod(SimpleBeanConfiguration.class, "simpleBean"); assertThat(method).isNotNull(); - assertThat(createInstance(innerBean).getTarget(innerBean, method)).isEqualTo(SimpleBeanFactoryBean.class); + assertThat(createInstance(innerBean).getTarget(innerBean, method)) + .isEqualTo(SimpleBeanConfiguration.class); } @Test diff --git a/spring-beans/src/testFixtures/java/org/springframework/beans/factory/aot/SimpleBeanConfiguration.java b/spring-beans/src/testFixtures/java/org/springframework/beans/factory/aot/SimpleBeanConfiguration.java new file mode 100644 index 00000000000..f1ac30e157e --- /dev/null +++ b/spring-beans/src/testFixtures/java/org/springframework/beans/factory/aot/SimpleBeanConfiguration.java @@ -0,0 +1,29 @@ +/* + * Copyright 2002-2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.beans.factory.aot; + +/** + * + * @author Stephane Nicoll + */ +public class SimpleBeanConfiguration { + + public SimpleBean simpleBean() { + return new SimpleBean(); + } + +}