Class JavaTestGenerator<T extends JavaTestGenerator<T>>
- java.lang.Object
-
- com.consol.citrus.generate.AbstractTestGenerator<T>
-
- com.consol.citrus.generate.javadsl.JavaTestGenerator<T>
-
- All Implemented Interfaces:
TestGenerator<T>
- Direct Known Subclasses:
JavaDslTestGenerator
public class JavaTestGenerator<T extends JavaTestGenerator<T>> extends AbstractTestGenerator<T>
- Since:
- 2.7.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.consol.citrus.generate.TestGenerator
TestGenerator.GeneratorMode
-
-
Field Summary
-
Fields inherited from class com.consol.citrus.generate.AbstractTestGenerator
log, self
-
-
Constructor Summary
Constructors Constructor Description JavaTestGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate()Create tests with this generator.protected com.squareup.javapoet.AnnotationSpec.BuildercreateAnnotationBuilder(String packageName, String simpleName)protected com.squareup.javapoet.JavaFile.BuildercreateJavaFileBuilder(com.squareup.javapoet.TypeSpec.Builder testTypeBuilder)protected List<com.squareup.javapoet.CodeBlock>getActions()List of test actions to be added as code to the method body section of the test.protected com.squareup.javapoet.AnnotationSpecgetBaseExtension()Gets the Junit5 base extension to use.protected com.squareup.javapoet.TypeNamegetBaseType()Gets the test class base type to extend from.protected com.squareup.javapoet.AnnotationSpecgetCitrusAnnotation()Gets the Citrus XML test annotation.TestGenerator.GeneratorModegetMode()Gets the mode.StringgetSrcDirectory()Get the test source directory.voidsetMode(TestGenerator.GeneratorMode mode)Sets the mode.TwithMode(TestGenerator.GeneratorMode mode)Set the mode describing which part (client/server) to use.-
Methods inherited from class com.consol.citrus.generate.AbstractTestGenerator
getAuthor, getCreationDate, getDescription, getFileExtension, getFramework, getMethodName, getName, getPackage, getTargetFile, getTargetPackage, getUpdateDateTime, isDisabled, setAuthor, setDescription, setDisabled, setFileExtension, setFramework, setName, setPackage, setSrcDirectory, setTargetPackage, usePackage, useSrcDirectory, withAuthor, withDescription, withDisabled, withFileExtension, withFramework, withName
-
-
-
-
Method Detail
-
create
public void create()
Description copied from interface:TestGeneratorCreate tests with this generator.
-
createJavaFileBuilder
protected com.squareup.javapoet.JavaFile.Builder createJavaFileBuilder(com.squareup.javapoet.TypeSpec.Builder testTypeBuilder)
-
getBaseType
protected com.squareup.javapoet.TypeName getBaseType()
Gets the test class base type to extend from.- Returns:
- TypeName of the base type
-
getBaseExtension
protected com.squareup.javapoet.AnnotationSpec getBaseExtension()
Gets the Junit5 base extension to use.- Returns:
- The AnnotationSpec of the Junit5 extension
-
getCitrusAnnotation
protected com.squareup.javapoet.AnnotationSpec getCitrusAnnotation()
Gets the Citrus XML test annotation.- Returns:
- The AnnotationSpec for XML tests
-
getActions
protected List<com.squareup.javapoet.CodeBlock> getActions()
List of test actions to be added as code to the method body section of the test.- Returns:
- A list of actions to execute
-
withMode
public T withMode(TestGenerator.GeneratorMode mode)
Set the mode describing which part (client/server) to use.- Parameters:
mode- The mode to generate the test for- Returns:
- The modified JavaTestGenerator
-
getSrcDirectory
public String getSrcDirectory()
Description copied from class:AbstractTestGeneratorGet the test source directory.- Overrides:
getSrcDirectoryin classAbstractTestGenerator<T extends JavaTestGenerator<T>>- Returns:
- the srcDirectory
-
getMode
public TestGenerator.GeneratorMode getMode()
Gets the mode.- Returns:
- The current mode
-
setMode
public void setMode(TestGenerator.GeneratorMode mode)
Sets the mode.- Parameters:
mode- The mode to set (client/server
-
-