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

public class JavaTestGenerator<T extends JavaTestGenerator<T>> extends AbstractTestGenerator<T>
Since:
2.7.4
  • Constructor Details

    • JavaTestGenerator

      public JavaTestGenerator()
  • Method Details

    • create

      public void create()
      Description copied from interface: TestGenerator
      Create 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: AbstractTestGenerator
      Get the test source directory.
      Overrides:
      getSrcDirectory in class AbstractTestGenerator<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
    • createAnnotationBuilder

      protected com.squareup.javapoet.AnnotationSpec.Builder createAnnotationBuilder(String packageName, String simpleName)