Class SwaggerJavaTestGenerator
java.lang.Object
org.citrusframework.generate.AbstractTestGenerator<T>
org.citrusframework.generate.javadsl.JavaTestGenerator<T>
org.citrusframework.generate.javadsl.JavaDslTestGenerator<T>
org.citrusframework.generate.javadsl.MessagingJavaTestGenerator<SwaggerJavaTestGenerator>
org.citrusframework.generate.javadsl.SwaggerJavaTestGenerator
- All Implemented Interfaces:
SwaggerTestGenerator<SwaggerJavaTestGenerator>,TestGenerator<SwaggerJavaTestGenerator>
public class SwaggerJavaTestGenerator
extends MessagingJavaTestGenerator<SwaggerJavaTestGenerator>
implements SwaggerTestGenerator<SwaggerJavaTestGenerator>
Test generator creates one to many test cases based on operations defined in a XML schema XSD.
- Since:
- 2.7.4
- Author:
- Christoph Deppisch
-
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.JavaFile.BuildercreateJavaFileBuilder(com.squareup.javapoet.TypeSpec.Builder testTypeBuilder) Gets the contextPath.Gets the namePrefix.Gets the nameSuffix.Gets the operation.Gets the swaggerResource.voidsetContextPath(String contextPath) Sets the contextPath.voidsetNamePrefix(String namePrefix) Sets the namePrefix.voidsetNameSuffix(String nameSuffix) Sets the nameSuffix.voidsetOperation(String operation) Sets the operation.voidsetSwaggerResource(String swaggerResource) Sets the swaggerResource.withContextPath(String contextPath) Set the server context path to use.withInboundMappingFile(String mappingFile) Add inbound JsonPath expression mappings file to manipulate inbound message content.withInboundMappings(Map<String, String> mappings) Add inbound JsonPath expression mappings to manipulate inbound message content.withNamePrefix(String prefix) Set the test name prefix to use.withNameSuffix(String suffix) Set the test name suffix to use.withOperation(String operation) Set the swagger operation to use.withOutboundMappingFile(String mappingFile) Add outbound JsonPath expression mappings file to manipulate outbound message content.withOutboundMappings(Map<String, String> mappings) Add outbound JsonPath expression mappings to manipulate outbound message content.Set the swagger Open API resource to use.Methods inherited from class org.citrusframework.generate.javadsl.MessagingJavaTestGenerator
addRequestHeader, addResponseHeader, generateInboundMessage, generateOutboundMessage, getActions, getEndpoint, getReceiveRequestCodeProvider, getReceiveResponseCodeProvider, getSendRequestCodeProvider, getSendResponseCodeProvider, setEndpoint, withEndpoint, withRequest, withResponseMethods inherited from class org.citrusframework.generate.javadsl.JavaDslTestGenerator
getBaseExtension, getCitrusAnnotationMethods inherited from class org.citrusframework.generate.javadsl.JavaTestGenerator
createAnnotationBuilder, getBaseType, getMode, getSrcDirectory, setMode, withModeMethods 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, withNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.citrusframework.generate.SwaggerTestGenerator
withEndpointMethods inherited from interface org.citrusframework.generate.TestGenerator
getAuthor, getDescription, getFramework, getMode, getName, getTargetPackage, isDisabled, usePackage, useSrcDirectory, withAuthor, withDescription, withDisabled, withFramework, withMode, withName
-
Constructor Details
-
SwaggerJavaTestGenerator
public SwaggerJavaTestGenerator()
-
-
Method Details
-
createJavaFileBuilder
protected com.squareup.javapoet.JavaFile.Builder createJavaFileBuilder(com.squareup.javapoet.TypeSpec.Builder testTypeBuilder) - Overrides:
createJavaFileBuilderin classMessagingJavaTestGenerator<SwaggerJavaTestGenerator>
-
create
public void create()Description copied from interface:TestGeneratorCreate tests with this generator.- Specified by:
createin interfaceTestGenerator<SwaggerJavaTestGenerator>- Overrides:
createin classJavaTestGenerator<SwaggerJavaTestGenerator>
-
withSpec
Set the swagger Open API resource to use.- Specified by:
withSpecin interfaceSwaggerTestGenerator<SwaggerJavaTestGenerator>- Parameters:
swaggerResource-- Returns:
-
withContextPath
Set the server context path to use.- Parameters:
contextPath-- Returns:
-
withNamePrefix
Set the test name prefix to use.- Specified by:
withNamePrefixin interfaceSwaggerTestGenerator<SwaggerJavaTestGenerator>- Parameters:
prefix-- Returns:
-
withNameSuffix
Set the test name suffix to use.- Specified by:
withNameSuffixin interfaceSwaggerTestGenerator<SwaggerJavaTestGenerator>- Parameters:
suffix-- Returns:
-
withOperation
Set the swagger operation to use.- Specified by:
withOperationin interfaceSwaggerTestGenerator<SwaggerJavaTestGenerator>- Parameters:
operation-- Returns:
-
withInboundMappings
Add inbound JsonPath expression mappings to manipulate inbound message content.- Specified by:
withInboundMappingsin interfaceSwaggerTestGenerator<SwaggerJavaTestGenerator>- Parameters:
mappings-- Returns:
-
withOutboundMappings
Add outbound JsonPath expression mappings to manipulate outbound message content.- Specified by:
withOutboundMappingsin interfaceSwaggerTestGenerator<SwaggerJavaTestGenerator>- Parameters:
mappings-- Returns:
-
withInboundMappingFile
Add inbound JsonPath expression mappings file to manipulate inbound message content.- Specified by:
withInboundMappingFilein interfaceSwaggerTestGenerator<SwaggerJavaTestGenerator>- Parameters:
mappingFile-- Returns:
-
withOutboundMappingFile
Add outbound JsonPath expression mappings file to manipulate outbound message content.- Specified by:
withOutboundMappingFilein interfaceSwaggerTestGenerator<SwaggerJavaTestGenerator>- Parameters:
mappingFile-- Returns:
-
getSwaggerResource
Gets the swaggerResource.- Specified by:
getSwaggerResourcein interfaceSwaggerTestGenerator<SwaggerJavaTestGenerator>- Returns:
-
setSwaggerResource
Sets the swaggerResource.- Parameters:
swaggerResource-
-
getContextPath
Gets the contextPath.- Returns:
-
setContextPath
Sets the contextPath.- Parameters:
contextPath-
-
setNameSuffix
Sets the nameSuffix.- Parameters:
nameSuffix-
-
getNameSuffix
Gets the nameSuffix.- Specified by:
getNameSuffixin interfaceSwaggerTestGenerator<SwaggerJavaTestGenerator>- Returns:
-
setNamePrefix
Sets the namePrefix.- Parameters:
namePrefix-
-
getNamePrefix
Gets the namePrefix.- Returns:
-
setOperation
Sets the operation.- Parameters:
operation-
-
getOperation
Gets the operation.- Specified by:
getOperationin interfaceSwaggerTestGenerator<SwaggerJavaTestGenerator>- Returns:
-