Spring WebTestClient Generator

Generates test for SpringMVC or Spring WebFlux using WebTestClient based on OpenAPI specification.

jbang zw -p io.zenwave360.sdk.plugins.SpringWebTestClientPlugin \
specFile=src/main/resources/model/openapi.yml \
targetFolder=src/test/java \
testsPackage=io.zenwave360.example.adapters.web.tests \
openApiApiPackage=io.zenwave360.example.adapters.web \
openApiModelPackage=io.zenwave360.example.adapters.web.model \
openApiModelNameSuffix=DTO \
groupBy=service
jbang zw -p io.zenwave360.sdk.plugins.SpringWebTestClientPlugin \
specFile=src/main/resources/model/openapi.yml \
targetFolder=src/test/java \
testsPackage=io.zenwave360.example.adapters.web.tests \
openApiApiPackage=io.zenwave360.example.adapters.web \
openApiModelPackage=io.zenwave360.example.adapters.web.model \
openApiModelNameSuffix=DTO \
groupBy=businessFlow \
businessFlowTestName=CustomerCRUDTest \
operationIds=createCustomer,getCustomer,updateCustomer,deleteCustomer

Options

OptionDescriptionTypeDefaultValues
specFileAPI Specification FileURI
targetFolderTarget folder to generate code to. If left empty, it will print to stdout.File
testsPackagePackage name for generated testsString{{basePackage}}.adapters.web.tests
groupByGenerate test classes grouped byGroupByTypeserviceservice, operation, partial, businessFlow
testSuffixClass name suffix for generated test classesStringIT
operationIdsOpenAPI operationIds to generate code forList[]
requestPayloadTypeWhether to use a JSON string or instantiate a java DTO as request payloadRequestPayloadTypejsonjson, dto
businessFlowTestNameBusiness Flow Test nameString
transactionalAnnotate tests as @Transactionalbooleantrue
transactionalAnnotationClass@Transactional annotation class nameStringorg.springframework.transaction.annotation.Transactional
basePackageApplications base packageString
openApiApiPackageThe package to used by OpenAPI-Generator for generated api objects/classesString
openApiModelPackageThe package to used by OpenAPI-Generator for generated model objects/classesString{{openApiApiPackage}}
openApiModelNamePrefixSets the prefix for model enums and classes used by OpenAPI-GeneratorString
openApiModelNameSuffixSets the suffix for model enums and classes used by OpenAPI-GeneratorString
statusCodesStatus codes to generate code forList[200, 201, 202, 400]

Getting Help

jbang zw -p io.zenwave360.sdk.plugins.SpringWebTestClientPlugin --help