public interface TestFeature extends DefaultFeature
| Modifier and Type | Method and Description |
|---|---|
default void |
apply(GeneratorContext generatorContext)
If this method is called for a given feature that means the feature was explicitly selected,
included by default as a result of
DefaultFeature.shouldApply(ApplicationType, io.micronaut.starter.options.Options, java.util.Set),
or added explicitly by another feature through FeatureContext.addFeature(Feature). |
void |
doApply(GeneratorContext generatorContext) |
default int |
getOrder()
The order of a feature controls the order in which it applies.
|
TestFramework |
getTestFramework() |
default boolean |
isJunit() |
default boolean |
isKoTest() |
default boolean |
isKotlinTestFramework() |
default boolean |
isSpock() |
default boolean |
isVisible()
Some features should not be visible to the user because they are a common parent of other
selectable features, or they should always be applied, or any other reason.
|
default boolean |
shouldApply(ApplicationType applicationType,
Options options,
java.util.Set<Feature> selectedFeatures)
Determines if the feature should be applied to the project.
|
default boolean |
supports(ApplicationType applicationType)
This method must be implemented to ensure it is only selectable for the desired
application types.
|
getCategory, getDescription, getMicronautDocumentation, getName, getThirdPartyDocumentation, getTitle, isPreview, processSelectedFeaturesdefault boolean isVisible()
Featuredefault int getOrder()
FeatureFeaturePhase
for a list of phases to choose from.default void apply(GeneratorContext generatorContext)
FeatureDefaultFeature.shouldApply(ApplicationType, io.micronaut.starter.options.Options, java.util.Set),
or added explicitly by another feature through FeatureContext.addFeature(Feature).
At this point the feature list is set and cannot change.
This method can be implemented to modify the generated project. The feature can add templates
by executing GeneratorContext.addTemplate(String, io.micronaut.starter.template.Template), modify configuration
by modifying GeneratorContext.getConfiguration() or GeneratorContext.getBootstrapConfiguration(), or modify build properties through GeneratorContext.getBuildProperties().void doApply(GeneratorContext generatorContext)
TestFramework getTestFramework()
default boolean isJunit()
default boolean isSpock()
default boolean isKotlinTestFramework()
default boolean isKoTest()
default boolean shouldApply(ApplicationType applicationType, Options options, java.util.Set<Feature> selectedFeatures)
DefaultFeatureshouldApply in interface DefaultFeatureapplicationType - The application typeoptions - The optionsselectedFeatures - The features manually selected by the userdefault boolean supports(ApplicationType applicationType)
Feature