Package com.consol.citrus.generate.xml
Class SwaggerXmlTestGenerator
- java.lang.Object
-
- com.consol.citrus.generate.AbstractTestGenerator<T>
-
- com.consol.citrus.generate.AbstractTemplateBasedTestGenerator<T>
-
- com.consol.citrus.generate.xml.XmlTestGenerator<T>
-
- com.consol.citrus.generate.xml.MessagingXmlTestGenerator<SwaggerXmlTestGenerator>
-
- com.consol.citrus.generate.xml.SwaggerXmlTestGenerator
-
- All Implemented Interfaces:
SwaggerTestGenerator<SwaggerXmlTestGenerator>,TestGenerator<SwaggerXmlTestGenerator>
public class SwaggerXmlTestGenerator extends MessagingXmlTestGenerator<SwaggerXmlTestGenerator> implements SwaggerTestGenerator<SwaggerXmlTestGenerator>
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 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 SwaggerXmlTestGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate()Create the test case.StringgetContextPath()Gets the contextPath.protected List<String>getMarshallerContextPaths()Marshaller context paths.protected List<org.springframework.core.io.Resource>getMarshallerSchemas()Marshaller schema.StringgetNamePrefix()Gets the namePrefix.StringgetNameSuffix()Gets the nameSuffix.StringgetOperation()Gets the operation.StringgetSwaggerResource()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.SwaggerXmlTestGeneratorwithContextPath(String contextPath)Set the server context path to use.SwaggerXmlTestGeneratorwithInboundMappingFile(String mappingFile)Add inbound JsonPath expression mappings file to manipulate inbound message content.SwaggerXmlTestGeneratorwithInboundMappings(Map<String,String> mappings)Add inbound JsonPath expression mappings to manipulate inbound message content.SwaggerXmlTestGeneratorwithNamePrefix(String prefix)Set the test name prefix to use.SwaggerXmlTestGeneratorwithNameSuffix(String suffix)Set the test name suffix to use.SwaggerXmlTestGeneratorwithOperation(String operation)Set the swagger operation to use.SwaggerXmlTestGeneratorwithOutboundMappingFile(String mappingFile)Add outbound JsonPath expression mappings file to manipulate outbound message content.SwaggerXmlTestGeneratorwithOutboundMappings(Map<String,String> mappings)Add outbound JsonPath expression mappings to manipulate outbound message content.SwaggerXmlTestGeneratorwithSpec(String swaggerResource)Set the swagger Open API resource to use.-
Methods inherited from class com.consol.citrus.generate.xml.MessagingXmlTestGenerator
addRequestHeader, addResponseHeader, generateInboundMessage, generateOutboundMessage, getActions, getEndpoint, getReceiveRequestActionProvider, getReceiveResponseActionProvider, getSendRequestActionProvider, getSendResponseActionProvider, setEndpoint, withEndpoint, withRequest, withResponse
-
Methods inherited from class com.consol.citrus.generate.xml.XmlTestGenerator
getJavaTestGenerator, getMarshaller, getMode, getSrcDirectory, getTemplateFilePath, getTemplateProperties, setMarshaller, setMode, withMode
-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.consol.citrus.generate.SwaggerTestGenerator
withEndpoint
-
Methods inherited from interface com.consol.citrus.generate.TestGenerator
getAuthor, getDescription, getFramework, getMode, getName, getTargetPackage, isDisabled, usePackage, useSrcDirectory, withAuthor, withDescription, withDisabled, withFramework, withMode, withName
-
-
-
-
Method Detail
-
create
public void create()
Description copied from class:AbstractTemplateBasedTestGeneratorCreate the test case.- Specified by:
createin interfaceTestGenerator<SwaggerXmlTestGenerator>- Overrides:
createin classXmlTestGenerator<SwaggerXmlTestGenerator>
-
getMarshallerContextPaths
protected List<String> getMarshallerContextPaths()
Description copied from class:XmlTestGeneratorMarshaller context paths. Subclasses may add additional packages.- Overrides:
getMarshallerContextPathsin classXmlTestGenerator<SwaggerXmlTestGenerator>- Returns:
-
getMarshallerSchemas
protected List<org.springframework.core.io.Resource> getMarshallerSchemas()
Description copied from class:XmlTestGeneratorMarshaller schema. Subclasses may overwrite schema or set to null to disable schema validation of marshalled data.- Overrides:
getMarshallerSchemasin classXmlTestGenerator<SwaggerXmlTestGenerator>- Returns:
-
withSpec
public SwaggerXmlTestGenerator withSpec(String swaggerResource)
Set the swagger Open API resource to use.- Specified by:
withSpecin interfaceSwaggerTestGenerator<SwaggerXmlTestGenerator>- Parameters:
swaggerResource-- Returns:
-
withContextPath
public SwaggerXmlTestGenerator withContextPath(String contextPath)
Set the server context path to use.- Parameters:
contextPath-- Returns:
-
withNamePrefix
public SwaggerXmlTestGenerator withNamePrefix(String prefix)
Set the test name prefix to use.- Specified by:
withNamePrefixin interfaceSwaggerTestGenerator<SwaggerXmlTestGenerator>- Parameters:
prefix-- Returns:
-
withNameSuffix
public SwaggerXmlTestGenerator withNameSuffix(String suffix)
Set the test name suffix to use.- Specified by:
withNameSuffixin interfaceSwaggerTestGenerator<SwaggerXmlTestGenerator>- Parameters:
suffix-- Returns:
-
withOperation
public SwaggerXmlTestGenerator withOperation(String operation)
Set the swagger operation to use.- Specified by:
withOperationin interfaceSwaggerTestGenerator<SwaggerXmlTestGenerator>- Parameters:
operation-- Returns:
-
withInboundMappings
public SwaggerXmlTestGenerator withInboundMappings(Map<String,String> mappings)
Add inbound JsonPath expression mappings to manipulate inbound message content.- Specified by:
withInboundMappingsin interfaceSwaggerTestGenerator<SwaggerXmlTestGenerator>- Parameters:
mappings-- Returns:
-
withOutboundMappings
public SwaggerXmlTestGenerator withOutboundMappings(Map<String,String> mappings)
Add outbound JsonPath expression mappings to manipulate outbound message content.- Specified by:
withOutboundMappingsin interfaceSwaggerTestGenerator<SwaggerXmlTestGenerator>- Parameters:
mappings-- Returns:
-
withInboundMappingFile
public SwaggerXmlTestGenerator withInboundMappingFile(String mappingFile)
Add inbound JsonPath expression mappings file to manipulate inbound message content.- Specified by:
withInboundMappingFilein interfaceSwaggerTestGenerator<SwaggerXmlTestGenerator>- Parameters:
mappingFile-- Returns:
-
withOutboundMappingFile
public SwaggerXmlTestGenerator withOutboundMappingFile(String mappingFile)
Add outbound JsonPath expression mappings file to manipulate outbound message content.- Specified by:
withOutboundMappingFilein interfaceSwaggerTestGenerator<SwaggerXmlTestGenerator>- Parameters:
mappingFile-- Returns:
-
getSwaggerResource
public String getSwaggerResource()
Gets the swaggerResource.- Specified by:
getSwaggerResourcein interfaceSwaggerTestGenerator<SwaggerXmlTestGenerator>- Returns:
-
setSwaggerResource
public void setSwaggerResource(String swaggerResource)
Sets the swaggerResource.- Parameters:
swaggerResource-
-
getContextPath
public String getContextPath()
Gets the contextPath.- Returns:
-
setContextPath
public void setContextPath(String contextPath)
Sets the contextPath.- Parameters:
contextPath-
-
setNameSuffix
public void setNameSuffix(String nameSuffix)
Sets the nameSuffix.- Parameters:
nameSuffix-
-
getNameSuffix
public String getNameSuffix()
Gets the nameSuffix.- Specified by:
getNameSuffixin interfaceSwaggerTestGenerator<SwaggerXmlTestGenerator>- Returns:
-
setNamePrefix
public void setNamePrefix(String namePrefix)
Sets the namePrefix.- Parameters:
namePrefix-
-
getNamePrefix
public String getNamePrefix()
Gets the namePrefix.- Returns:
-
setOperation
public void setOperation(String operation)
Sets the operation.- Parameters:
operation-
-
getOperation
public String getOperation()
Gets the operation.- Specified by:
getOperationin interfaceSwaggerTestGenerator<SwaggerXmlTestGenerator>- Returns:
-
-