public class ProjectAssetTester extends AbstractProjectGenerationTester<ProjectAssetTester>
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.
AbstractProjectGenerationTester.ProjectGenerationInvoker<T>
Constructor and Description |
---|
ProjectAssetTester() |
Modifier and Type | Method and Description |
---|---|
void |
configure(MutableProjectDescription description,
ContextConsumer<AssertableApplicationContext> consumer)
Configure a
ProjectGenerationContext using the specified
description and use the ContextConsumer to assert the context. |
ProjectStructure |
generate(MutableProjectDescription description)
Generate a project structure using only explicitly configured
contributors . |
<T> T |
generate(MutableProjectDescription description,
ProjectAssetGenerator<T> projectAssetGenerator)
Generate a project asset using the specified
ProjectAssetGenerator . |
protected ProjectAssetTester |
newInstance(Map<Class<?>,Supplier<?>> beanDefinitions,
Consumer<ProjectGenerationContext> contextInitializer,
Consumer<MutableProjectDescription> descriptionCustomizer) |
invokeProjectGeneration, withBean, withConfiguration, withContextInitializer, withDescriptionCustomizer, withDirectory, withIndentingWriterFactory
protected ProjectAssetTester newInstance(Map<Class<?>,Supplier<?>> beanDefinitions, Consumer<ProjectGenerationContext> contextInitializer, Consumer<MutableProjectDescription> descriptionCustomizer)
newInstance
in class AbstractProjectGenerationTester<ProjectAssetTester>
public void configure(MutableProjectDescription description, ContextConsumer<AssertableApplicationContext> consumer)
ProjectGenerationContext
using the specified
description
and use the ContextConsumer
to assert the context.description
- the description of the project to configureconsumer
- the consumer of the created ProjectGenerationContext
AbstractApplicationContextRunner.run(ContextConsumer)
public <T> T generate(MutableProjectDescription description, ProjectAssetGenerator<T> projectAssetGenerator)
ProjectAssetGenerator
.T
- the project asset typedescription
- the description of the project to generateprojectAssetGenerator
- the ProjectAssetGenerator
to invokeAbstractProjectGenerationTester.withConfiguration(Class[])
public ProjectStructure generate(MutableProjectDescription description)
contributors
.description
- the description of the project to generateProjectProjectStructure
of the generated projectAbstractProjectGenerationTester.withConfiguration(Class[])
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.