Polish
This commit is contained in:
parent
c9faff7491
commit
dcad3beeb9
|
@ -26,7 +26,12 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
|||
import org.springframework.beans.factory.support.RegisteredBean;
|
||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
import org.springframework.beans.testfixture.beans.factory.DummyFactory;
|
||||
import org.springframework.beans.testfixture.beans.factory.aot.GenericFactoryBean;
|
||||
import org.springframework.beans.testfixture.beans.factory.aot.MockBeanRegistrationsCode;
|
||||
import org.springframework.beans.testfixture.beans.factory.aot.NumberFactoryBean;
|
||||
import org.springframework.beans.testfixture.beans.factory.aot.SimpleBean;
|
||||
import org.springframework.beans.testfixture.beans.factory.aot.SimpleBeanConfiguration;
|
||||
import org.springframework.beans.testfixture.beans.factory.aot.SimpleBeanFactoryBean;
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.testfixture.aot.generate.TestGenerationContext;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.springframework.beans.testfixture.beans.factory.aot;
|
|||
import java.util.function.Consumer;
|
||||
|
||||
import org.springframework.javapoet.TypeSpec;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
|
@ -30,6 +31,7 @@ import org.springframework.util.Assert;
|
|||
*/
|
||||
public class DeferredTypeBuilder implements Consumer<TypeSpec.Builder> {
|
||||
|
||||
@Nullable
|
||||
private Consumer<TypeSpec.Builder> type;
|
||||
|
||||
@Override
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.beans.factory.aot;
|
||||
package org.springframework.beans.testfixture.beans.factory.aot;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
|
@ -42,16 +42,13 @@ public class MockBeanFactoryInitializationCode implements BeanFactoryInitializat
|
|||
|
||||
|
||||
public MockBeanFactoryInitializationCode(GenerationContext generationContext) {
|
||||
this.generatedClass = generationContext.getGeneratedClasses().addForFeature("TestCode", typeBuilder);
|
||||
this.generatedClass = generationContext.getGeneratedClasses()
|
||||
.addForFeature("TestCode", this.typeBuilder);
|
||||
}
|
||||
|
||||
|
||||
public DeferredTypeBuilder getTypeBuilder() {
|
||||
return typeBuilder;
|
||||
}
|
||||
|
||||
public GeneratedClass getGeneratedClass() {
|
||||
return generatedClass;
|
||||
return this.typeBuilder;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -48,11 +48,7 @@ public class MockBeanRegistrationCode implements BeanRegistrationCode {
|
|||
|
||||
|
||||
public DeferredTypeBuilder getTypeBuilder() {
|
||||
return typeBuilder;
|
||||
}
|
||||
|
||||
public GeneratedClass getGeneratedClass() {
|
||||
return this.generatedClass;
|
||||
return this.typeBuilder;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -41,11 +41,7 @@ public class MockBeanRegistrationsCode implements BeanRegistrationsCode {
|
|||
|
||||
|
||||
public DeferredTypeBuilder getTypeBuilder() {
|
||||
return typeBuilder;
|
||||
}
|
||||
|
||||
public GeneratedClass getGeneratedClass() {
|
||||
return this.generatedClass;
|
||||
return this.typeBuilder;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.beans.factory.aot;
|
||||
package org.springframework.beans.testfixture.beans.factory.aot;
|
||||
|
||||
/**
|
||||
* A {@link GenericFactoryBean} that has a bound for the target type.
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.beans.factory.aot;
|
||||
package org.springframework.beans.testfixture.beans.factory.aot;
|
||||
|
||||
/**
|
||||
* An empty test bean used by code generation.
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.beans.factory.aot;
|
||||
package org.springframework.beans.testfixture.beans.factory.aot;
|
||||
|
||||
/**
|
||||
*
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.beans.factory.aot;
|
||||
package org.springframework.beans.testfixture.beans.factory.aot;
|
||||
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
|
Loading…
Reference in New Issue