Class JavaTestGenerator<T extends JavaTestGenerator<T>>
java.lang.Object
org.citrusframework.generate.AbstractTestGenerator<T>
org.citrusframework.generate.javadsl.JavaTestGenerator<T>
- All Implemented Interfaces:
TestGenerator<T>
- Direct Known Subclasses:
JavaDslTestGenerator
- Since:
- 2.7.4
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.citrusframework.generate.TestGenerator
TestGenerator.GeneratorMode -
Field Summary
Fields inherited from class org.citrusframework.generate.AbstractTestGenerator
self -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()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>List of test actions to be added as code to the method body section of the test.protected com.squareup.javapoet.AnnotationSpecGets the Junit5 base extension to use.protected com.squareup.javapoet.TypeNameGets the test class base type to extend from.protected com.squareup.javapoet.AnnotationSpecGets the Citrus XML test annotation.getMode()Gets the mode.Get the test source directory.voidSets the mode.Set the mode describing which part (client/server) to use.Methods inherited from class org.citrusframework.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
-
Constructor Details
-
JavaTestGenerator
public JavaTestGenerator()
-
-
Method Details
-
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
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
Set the mode describing which part (client/server) to use.- Parameters:
mode- The mode to generate the test for- Returns:
- The modified JavaTestGenerator
-
getSrcDirectory
Description copied from class:AbstractTestGeneratorGet the test source directory.- Overrides:
getSrcDirectoryin classAbstractTestGenerator<T extends JavaTestGenerator<T>>- Returns:
- the srcDirectory
-
getMode
Gets the mode.- Returns:
- The current mode
-
setMode
Sets the mode.- Parameters:
mode- The mode to set (client/server
-
createAnnotationBuilder
-