Class ProjectAssetTester
java.lang.Object
io.spring.initializr.generator.test.project.AbstractProjectGenerationTester<ProjectAssetTester>
io.spring.initializr.generator.test.project.ProjectAssetTester
A tester for project asset that does not detect available
contributors and does not register any bean to the context. Contributors can be added
using bean registration, a
configuration class or via the
customization of the project generation
context.
Alternatively, the context can be queried the same way ApplicationContextRunner
works by configuring the context.
- Author:
- Stephane Nicoll
-
Nested Class Summary
Nested classes/interfaces inherited from class io.spring.initializr.generator.test.project.AbstractProjectGenerationTester
AbstractProjectGenerationTester.ProjectGenerationInvoker<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(MutableProjectDescription description, ContextConsumer<AssertableApplicationContext> consumer) Configure aProjectGenerationContextusing the specifieddescriptionand use theContextConsumerto assert the context.generate(MutableProjectDescription description) Generate a project structure using only explicitly configuredcontributors.<T> Tgenerate(MutableProjectDescription description, ProjectAssetGenerator<T> projectAssetGenerator) Generate a project asset using the specifiedProjectAssetGenerator.protected ProjectAssetTesternewInstance(Map<Class<?>, Supplier<?>> beanDefinitions, Consumer<ProjectGenerationContext> contextInitializer, Consumer<MutableProjectDescription> descriptionCustomizer) Methods inherited from class io.spring.initializr.generator.test.project.AbstractProjectGenerationTester
invokeProjectGeneration, withBean, withConfiguration, withContextInitializer, withDescriptionCustomizer, withDirectory, withIndentingWriterFactory
-
Constructor Details
-
ProjectAssetTester
public ProjectAssetTester()
-
-
Method Details
-
newInstance
protected ProjectAssetTester newInstance(Map<Class<?>, Supplier<?>> beanDefinitions, Consumer<ProjectGenerationContext> contextInitializer, Consumer<MutableProjectDescription> descriptionCustomizer) - Specified by:
newInstancein classAbstractProjectGenerationTester<ProjectAssetTester>
-
configure
public void configure(MutableProjectDescription description, ContextConsumer<AssertableApplicationContext> consumer) Configure aProjectGenerationContextusing the specifieddescriptionand use theContextConsumerto assert the context.- Parameters:
description- the description of the project to configureconsumer- the consumer of the createdProjectGenerationContext- See Also:
-
generate
public <T> T generate(MutableProjectDescription description, ProjectAssetGenerator<T> projectAssetGenerator) Generate a project asset using the specifiedProjectAssetGenerator.- Type Parameters:
T- the project asset type- Parameters:
description- the description of the project to generateprojectAssetGenerator- theProjectAssetGeneratorto invoke- Returns:
- the project asset
- See Also:
-
generate
Generate a project structure using only explicitly configuredcontributors.- Parameters:
description- the description of the project to generateProject- Returns:
- the
ProjectStructureof the generated project - See Also:
-