Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public class {{classname}}MockServer {
@Deprecated
{{/isDeprecated}}
public static MappingBuilder stub{{#lambda.pascalcase}}{{operationId}}{{/lambda.pascalcase}}{{{code}}}({{#allParams}}{{#required}}{{#isNullable}}@{{javaxPackage}}.annotation.Nullable {{/isNullable}}{{^isNullable}}@{{javaxPackage}}.annotation.Nonnull {{/isNullable}}{{/required}}{{^required}}@{{javaxPackage}}.annotation.Nullable {{/required}}{{^isBodyParam}}String {{paramName}}{{/isBodyParam}}{{#isBodyParam}}String body{{/isBodyParam}}{{^-last}}, {{/-last}}{{#-last}}{{#headers.0}}, {{/headers.0}}{{^headers.0}}{{#returnType}}, {{/returnType}}{{/headers.0}}{{/-last}}{{/allParams}}{{#headers}}String response{{#lambda.pascalcase}}{{baseName}}{{/lambda.pascalcase}}{{^-last}}, {{/-last}}{{#-last}}{{#returnType}}, {{/returnType}}{{/-last}}{{/headers}}{{#returnType}}String response{{/returnType}}) {
MappingBuilder stub = {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}({{^pathParams.0}}urlPathEqualTo{{/pathParams.0}}{{#pathParams.0}}urlPathTemplate{{/pathParams.0}}("{{{path}}}")){{#hasProduces}}
.withHeader("Accept", havingExactly({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}})){{/hasProduces}}{{#hasAuthMethods}}{{#hasConsumes}}
.withHeader("Content-Type", havingExactly("{{#consumes.0}}{{{mediaType}}}{{/consumes.0}}")){{/hasConsumes}}
MappingBuilder stub = {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}({{^pathParams.0}}urlPathEqualTo{{/pathParams.0}}{{#pathParams.0}}urlPathTemplate{{/pathParams.0}}("{{{path}}}")){{#hasProduces}}{{#produces}}
.withHeader("Accept", containing("{{{mediaType}}}")){{/produces}}{{/hasProduces}}{{#hasAuthMethods}}{{#hasConsumes}}
.withHeader("Content-Type", havingExactly(equalToIgnoreCase("{{#consumes.0}}{{{mediaType}}}{{/consumes.0}}"))){{/hasConsumes}}
.withHeader("Authorization", matching(".*")){{/hasAuthMethods}}{{#cookieParams}}
.withCookie("{{baseName}}", havingExactly({{paramName}})){{/cookieParams}}{{#hasBodyParam}}
.withRequestBody(equalToJson(body)){{/hasBodyParam}}
Expand Down Expand Up @@ -105,9 +105,9 @@ public class {{classname}}MockServer {
{{/responses}}

public static MappingBuilder stub{{#lambda.pascalcase}}{{operationId}}{{/lambda.pascalcase}}Fault({{#allParams}}{{#required}}{{#isNullable}}@{{javaxPackage}}.annotation.Nullable {{/isNullable}}{{^isNullable}}@{{javaxPackage}}.annotation.Nonnull {{/isNullable}}{{/required}}{{^required}}@{{javaxPackage}}.annotation.Nullable {{/required}}{{^isBodyParam}}String {{paramName}}{{/isBodyParam}}{{#isBodyParam}}String body{{/isBodyParam}}, {{/allParams}}Fault fault) {
MappingBuilder stub = {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}({{^pathParams.0}}urlPathEqualTo{{/pathParams.0}}{{#pathParams.0}}urlPathTemplate{{/pathParams.0}}("{{{path}}}")){{#hasProduces}}
.withHeader("Accept", havingExactly({{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}})){{/hasProduces}}{{#hasAuthMethods}}{{#hasConsumes}}
.withHeader("Content-Type", havingExactly("{{#consumes.0}}{{{mediaType}}}{{/consumes.0}}")){{/hasConsumes}}
MappingBuilder stub = {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}({{^pathParams.0}}urlPathEqualTo{{/pathParams.0}}{{#pathParams.0}}urlPathTemplate{{/pathParams.0}}("{{{path}}}")){{#hasProduces}}{{#produces}}
.withHeader("Accept", containing("{{{mediaType}}}")){{/produces}}{{/hasProduces}}{{#hasAuthMethods}}{{#hasConsumes}}
.withHeader("Content-Type", havingExactly(equalToIgnoreCase("{{#consumes.0}}{{{mediaType}}}{{/consumes.0}}"))){{/hasConsumes}}
.withHeader("Authorization", matching(".*")){{/hasAuthMethods}}{{#cookieParams}}
.withCookie("{{baseName}}", havingExactly({{paramName}})){{/cookieParams}}{{#bodyParam}}
.withRequestBody(equalToJson(body)){{/bodyParam}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class AnotherFakeApiMockServer {

public static MappingBuilder stubCall123testSpecialTags200(@javax.annotation.Nonnull String body, String response) {
MappingBuilder stub = patch(urlPathEqualTo("/another-fake/dummy"))
.withHeader("Accept", havingExactly("application/json"))
.withHeader("Accept", containing("application/json"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withStatus(200)
Expand All @@ -27,7 +27,7 @@ public static MappingBuilder stubCall123testSpecialTags200(@javax.annotation.Non

public static MappingBuilder stubCall123testSpecialTagsFault(@javax.annotation.Nonnull String body, Fault fault) {
MappingBuilder stub = patch(urlPathEqualTo("/another-fake/dummy"))
.withHeader("Accept", havingExactly("application/json"))
.withHeader("Accept", containing("application/json"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withFault(fault)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class DefaultApiMockServer {

public static MappingBuilder stubFooGet0(String response) {
MappingBuilder stub = get(urlPathEqualTo("/foo"))
.withHeader("Accept", havingExactly("application/json"))
.withHeader("Accept", containing("application/json"))
.willReturn(aResponse()
.withStatus(0)
.withHeader("Content-Type", "application/json")
Expand All @@ -26,7 +26,7 @@ public static MappingBuilder stubFooGet0(String response) {

public static MappingBuilder stubFooGetFault(Fault fault) {
MappingBuilder stub = get(urlPathEqualTo("/foo"))
.withHeader("Accept", havingExactly("application/json"))
.withHeader("Accept", containing("application/json"))
.willReturn(aResponse()
.withFault(fault)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class FakeApiMockServer {

public static MappingBuilder stubFakeBigDecimalMap200(String response) {
MappingBuilder stub = get(urlPathEqualTo("/fake/BigDecimalMap"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "*/*")
Expand All @@ -26,7 +26,7 @@ public static MappingBuilder stubFakeBigDecimalMap200(String response) {

public static MappingBuilder stubFakeBigDecimalMapFault(Fault fault) {
MappingBuilder stub = get(urlPathEqualTo("/fake/BigDecimalMap"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.willReturn(aResponse()
.withFault(fault)
);
Expand All @@ -43,7 +43,7 @@ public static String fakeBigDecimalMap200ResponseSample1() {

public static MappingBuilder stubFakeHealthGet200(String response) {
MappingBuilder stub = get(urlPathEqualTo("/fake/health"))
.withHeader("Accept", havingExactly("application/json"))
.withHeader("Accept", containing("application/json"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
Expand All @@ -56,7 +56,7 @@ public static MappingBuilder stubFakeHealthGet200(String response) {

public static MappingBuilder stubFakeHealthGetFault(Fault fault) {
MappingBuilder stub = get(urlPathEqualTo("/fake/health"))
.withHeader("Accept", havingExactly("application/json"))
.withHeader("Accept", containing("application/json"))
.willReturn(aResponse()
.withFault(fault)
);
Expand All @@ -73,7 +73,7 @@ public static String fakeHealthGet200ResponseSample1() {

public static MappingBuilder stubFakeHttpSignatureTest200(@javax.annotation.Nonnull String body, @javax.annotation.Nullable String query1, @javax.annotation.Nullable String header1) {
MappingBuilder stub = get(urlPathEqualTo("/fake/http-signature-test"))
.withHeader("Content-Type", havingExactly("application/json"))
.withHeader("Content-Type", havingExactly(equalToIgnoreCase("application/json")))
.withHeader("Authorization", matching(".*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
Expand All @@ -92,7 +92,7 @@ public static MappingBuilder stubFakeHttpSignatureTest200(@javax.annotation.Nonn

public static MappingBuilder stubFakeHttpSignatureTestFault(@javax.annotation.Nonnull String body, @javax.annotation.Nullable String query1, @javax.annotation.Nullable String header1, Fault fault) {
MappingBuilder stub = get(urlPathEqualTo("/fake/http-signature-test"))
.withHeader("Content-Type", havingExactly("application/json"))
.withHeader("Content-Type", havingExactly(equalToIgnoreCase("application/json")))
.withHeader("Authorization", matching(".*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
Expand Down Expand Up @@ -120,7 +120,7 @@ public static String fakeHttpSignatureTestRequestSample2() {

public static MappingBuilder stubFakeOuterBooleanSerialize200(@javax.annotation.Nullable String body, String response) {
MappingBuilder stub = post(urlPathEqualTo("/fake/outer/boolean"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withStatus(200)
Expand All @@ -134,7 +134,7 @@ public static MappingBuilder stubFakeOuterBooleanSerialize200(@javax.annotation.

public static MappingBuilder stubFakeOuterBooleanSerializeFault(@javax.annotation.Nullable String body, Fault fault) {
MappingBuilder stub = post(urlPathEqualTo("/fake/outer/boolean"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withFault(fault)
Expand All @@ -152,7 +152,7 @@ public static String fakeOuterBooleanSerializeRequestSample1() {

public static MappingBuilder stubFakeOuterCompositeSerialize200(@javax.annotation.Nullable String body, String response) {
MappingBuilder stub = post(urlPathEqualTo("/fake/outer/composite"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withStatus(200)
Expand All @@ -166,7 +166,7 @@ public static MappingBuilder stubFakeOuterCompositeSerialize200(@javax.annotatio

public static MappingBuilder stubFakeOuterCompositeSerializeFault(@javax.annotation.Nullable String body, Fault fault) {
MappingBuilder stub = post(urlPathEqualTo("/fake/outer/composite"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withFault(fault)
Expand All @@ -187,7 +187,7 @@ public static String fakeOuterCompositeSerializeRequestSample1() {

public static MappingBuilder stubFakeOuterNumberSerialize200(@javax.annotation.Nullable String body, String response) {
MappingBuilder stub = post(urlPathEqualTo("/fake/outer/number"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withStatus(200)
Expand All @@ -201,7 +201,7 @@ public static MappingBuilder stubFakeOuterNumberSerialize200(@javax.annotation.N

public static MappingBuilder stubFakeOuterNumberSerializeFault(@javax.annotation.Nullable String body, Fault fault) {
MappingBuilder stub = post(urlPathEqualTo("/fake/outer/number"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withFault(fault)
Expand All @@ -219,7 +219,7 @@ public static String fakeOuterNumberSerializeRequestSample1() {

public static MappingBuilder stubFakeOuterStringSerialize200(@javax.annotation.Nullable String body, String response) {
MappingBuilder stub = post(urlPathEqualTo("/fake/outer/string"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withStatus(200)
Expand All @@ -233,7 +233,7 @@ public static MappingBuilder stubFakeOuterStringSerialize200(@javax.annotation.N

public static MappingBuilder stubFakeOuterStringSerializeFault(@javax.annotation.Nullable String body, Fault fault) {
MappingBuilder stub = post(urlPathEqualTo("/fake/outer/string"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withFault(fault)
Expand All @@ -251,7 +251,7 @@ public static String fakeOuterStringSerializeRequestSample1() {

public static MappingBuilder stubFakePropertyEnumIntegerSerialize200(@javax.annotation.Nonnull String body, String response) {
MappingBuilder stub = post(urlPathEqualTo("/fake/property/enum-int"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withStatus(200)
Expand All @@ -265,7 +265,7 @@ public static MappingBuilder stubFakePropertyEnumIntegerSerialize200(@javax.anno

public static MappingBuilder stubFakePropertyEnumIntegerSerializeFault(@javax.annotation.Nonnull String body, Fault fault) {
MappingBuilder stub = post(urlPathEqualTo("/fake/property/enum-int"))
.withHeader("Accept", havingExactly("*/*"))
.withHeader("Accept", containing("*/*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withFault(fault)
Expand Down Expand Up @@ -400,7 +400,7 @@ public static String testBodyWithQueryParamsRequestSample1() {

public static MappingBuilder stubTestClientModel200(@javax.annotation.Nonnull String body, String response) {
MappingBuilder stub = patch(urlPathEqualTo("/fake"))
.withHeader("Accept", havingExactly("application/json"))
.withHeader("Accept", containing("application/json"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withStatus(200)
Expand All @@ -414,7 +414,7 @@ public static MappingBuilder stubTestClientModel200(@javax.annotation.Nonnull St

public static MappingBuilder stubTestClientModelFault(@javax.annotation.Nonnull String body, Fault fault) {
MappingBuilder stub = patch(urlPathEqualTo("/fake"))
.withHeader("Accept", havingExactly("application/json"))
.withHeader("Accept", containing("application/json"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
.withFault(fault)
Expand All @@ -435,7 +435,7 @@ public static String testClientModelRequestSample1() {

public static MappingBuilder stubTestEndpointParameters400(@javax.annotation.Nonnull String number, @javax.annotation.Nonnull String _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull String _byte, @javax.annotation.Nullable String integer, @javax.annotation.Nullable String int32, @javax.annotation.Nullable String int64, @javax.annotation.Nullable String _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable String binary, @javax.annotation.Nullable String date, @javax.annotation.Nullable String dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback) {
MappingBuilder stub = post(urlPathEqualTo("/fake"))
.withHeader("Content-Type", havingExactly("application/x-www-form-urlencoded"))
.withHeader("Content-Type", havingExactly(equalToIgnoreCase("application/x-www-form-urlencoded")))
.withHeader("Authorization", matching(".*"))
.willReturn(aResponse()
.withStatus(400)
Expand Down Expand Up @@ -481,7 +481,7 @@ public static MappingBuilder stubTestEndpointParameters400(@javax.annotation.Non

public static MappingBuilder stubTestEndpointParameters404(@javax.annotation.Nonnull String number, @javax.annotation.Nonnull String _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull String _byte, @javax.annotation.Nullable String integer, @javax.annotation.Nullable String int32, @javax.annotation.Nullable String int64, @javax.annotation.Nullable String _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable String binary, @javax.annotation.Nullable String date, @javax.annotation.Nullable String dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback) {
MappingBuilder stub = post(urlPathEqualTo("/fake"))
.withHeader("Content-Type", havingExactly("application/x-www-form-urlencoded"))
.withHeader("Content-Type", havingExactly(equalToIgnoreCase("application/x-www-form-urlencoded")))
.withHeader("Authorization", matching(".*"))
.willReturn(aResponse()
.withStatus(404)
Expand Down Expand Up @@ -527,7 +527,7 @@ public static MappingBuilder stubTestEndpointParameters404(@javax.annotation.Non

public static MappingBuilder stubTestEndpointParametersFault(@javax.annotation.Nonnull String number, @javax.annotation.Nonnull String _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull String _byte, @javax.annotation.Nullable String integer, @javax.annotation.Nullable String int32, @javax.annotation.Nullable String int64, @javax.annotation.Nullable String _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable String binary, @javax.annotation.Nullable String date, @javax.annotation.Nullable String dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback, Fault fault) {
MappingBuilder stub = post(urlPathEqualTo("/fake"))
.withHeader("Content-Type", havingExactly("application/x-www-form-urlencoded"))
.withHeader("Content-Type", havingExactly(equalToIgnoreCase("application/x-www-form-urlencoded")))
.withHeader("Authorization", matching(".*"))
.willReturn(aResponse()
.withFault(fault)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class FakeClassnameTags123ApiMockServer {

public static MappingBuilder stubTestClassname200(@javax.annotation.Nonnull String body, String response) {
MappingBuilder stub = patch(urlPathEqualTo("/fake_classname_test"))
.withHeader("Accept", havingExactly("application/json"))
.withHeader("Content-Type", havingExactly("application/json"))
.withHeader("Accept", containing("application/json"))
.withHeader("Content-Type", havingExactly(equalToIgnoreCase("application/json")))
.withHeader("Authorization", matching(".*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
Expand All @@ -29,8 +29,8 @@ public static MappingBuilder stubTestClassname200(@javax.annotation.Nonnull Stri

public static MappingBuilder stubTestClassnameFault(@javax.annotation.Nonnull String body, Fault fault) {
MappingBuilder stub = patch(urlPathEqualTo("/fake_classname_test"))
.withHeader("Accept", havingExactly("application/json"))
.withHeader("Content-Type", havingExactly("application/json"))
.withHeader("Accept", containing("application/json"))
.withHeader("Content-Type", havingExactly(equalToIgnoreCase("application/json")))
.withHeader("Authorization", matching(".*"))
.withRequestBody(equalToJson(body))
.willReturn(aResponse()
Expand Down
Loading
Loading