Skip to content

Commit

Permalink
fix: paths to partial templates for java
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Jan 10, 2024
1 parent d7c1c8b commit fb026e9
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion templates/java/tests/client/method.mustache
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
client{{#path}}.{{.}}{{/path}}({{#parametersWithDataType}}{{> generateParams}}{{^-last}},{{/-last}}{{/parametersWithDataType}});
client{{#path}}.{{.}}{{/path}}({{#parametersWithDataType}}{{> tests/generateParams}}{{^-last}},{{/-last}}{{/parametersWithDataType}});
EchoResponse result = echo.getLastResponse();
6 changes: 3 additions & 3 deletions templates/java/tests/client/step.mustache
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{#isCreateClient}}
{{> client/createClient}}
{{> tests/client/createClient}}
{{/isCreateClient}}
{{#isVariable}}
{{> client/variable}}
{{> tests/client/variable}}
{{/isVariable}}
{{#isMethod}}
{{> client/method}}
{{> tests/client/method}}
{{/isMethod}}
4 changes: 2 additions & 2 deletions templates/java/tests/client/suite.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ class {{client}}ClientTests {
{{#isError}}
{
Exception exception = assertThrows(Exception.class, () -> {
{{> client/step}}
{{> tests/client/step}}
});
assertEquals("{{{expectedError}}}", exception.getMessage());
}
{{/isError}}
{{^isError}}
{{> client/step}}
{{> tests/client/step}}
{{#match}}
{{#testUserAgent}} {
String regexp = "{{#lambda.escapeSlash}}{{{match}}}{{/lambda.escapeSlash}}";
Expand Down
8 changes: 4 additions & 4 deletions templates/java/tests/generateInnerParams.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
{{{objectName}}}.fromValue("{{{value}}}")
{{/isEnum}}
{{#isArray}}
List.of({{#value}}{{> generateParams}}{{^-last}},{{/-last}}{{/value}})
List.of({{#value}}{{> tests/generateParams}}{{^-last}},{{/-last}}{{/value}})
{{/isArray}}
{{#isObject}}
new {{{objectName}}}()
{{#value}}{{#isAdditionalProperty}}.setAdditionalProperty("{{{key}}}", {{> generateParams}}){{/isAdditionalProperty}}{{^isAdditionalProperty}}.set{{#lambda.pascalcase}}{{{key}}}{{/lambda.pascalcase}}({{> generateParams}}){{/isAdditionalProperty}}{{/value}}
{{#value}}{{#isAdditionalProperty}}.setAdditionalProperty("{{{key}}}", {{> tests/generateParams}}){{/isAdditionalProperty}}{{^isAdditionalProperty}}.set{{#lambda.pascalcase}}{{{key}}}{{/lambda.pascalcase}}({{> tests/generateParams}}){{/isAdditionalProperty}}{{/value}}
{{/isObject}}
{{#isFreeFormObject}}
{{#isAnyType}}
Map.of({{#value}}{{#entrySet}}"{{{key}}}", "{{{value}}}"{{^-last}},{{/-last}}{{/entrySet}}{{/value}})
{{/isAnyType}}
{{^isAnyType}}
Map.of({{#value}}"{{{key}}}", {{> generateParams}}{{^-last}},{{/-last}}{{/value}})
Map.of({{#value}}"{{{key}}}", {{> tests/generateParams}}{{^-last}},{{/-last}}{{/value}})
{{/isAnyType}}
{{/isFreeFormObject}}
{{/isFreeFormObject}}
2 changes: 1 addition & 1 deletion templates/java/tests/generateParams.mustache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#oneOfModel}}{{^hasWrapper}}{{> generateInnerParams}}{{/hasWrapper}}{{#hasWrapper}}{{{parentClassName}}}.of{{#x-one-of-explicit-name}}{{{type}}}{{/x-one-of-explicit-name}}({{> generateInnerParams}}){{/hasWrapper}}{{/oneOfModel}}{{^oneOfModel}}{{> generateInnerParams}}{{/oneOfModel}}
{{#oneOfModel}}{{^hasWrapper}}{{> tests/generateInnerParams}}{{/hasWrapper}}{{#hasWrapper}}{{{parentClassName}}}.of{{#x-one-of-explicit-name}}{{{type}}}{{/x-one-of-explicit-name}}({{> tests/generateInnerParams}}){{/hasWrapper}}{{/oneOfModel}}{{^oneOfModel}}{{> tests/generateInnerParams}}{{/oneOfModel}}
6 changes: 3 additions & 3 deletions templates/java/tests/requests/requests.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class {{client}}RequestsTests {
@DisplayName("{{{testName}}}")
void {{method}}Test{{testIndex}}() {
assertDoesNotThrow(() -> {
client.{{method}}({{#parametersWithDataType}}{{> generateParams}}{{^-last}},{{/-last}}{{/parametersWithDataType}}{{#isGeneric}}, Object.class{{/isGeneric}}{{#hasRequestOptions}}, new RequestOptions()
client.{{method}}({{#parametersWithDataType}}{{> tests/generateParams}}{{^-last}},{{/-last}}{{/parametersWithDataType}}{{#isGeneric}}, Object.class{{/isGeneric}}{{#hasRequestOptions}}, new RequestOptions()
{{#requestOptions.queryParameters.parametersWithDataType}}
.addExtraQueryParameters("{{{key}}}", {{> generateInnerParams}})
.addExtraQueryParameters("{{{key}}}", {{> tests/generateInnerParams}})
{{/requestOptions.queryParameters.parametersWithDataType}}
{{#requestOptions.headers.parametersWithDataType}}
.addExtraHeader("{{{key}}}", "{{{value}}}")
Expand Down Expand Up @@ -106,4 +106,4 @@ class {{client}}RequestsTests {
}
{{/tests}}
{{/blocksRequests}}
}
}

0 comments on commit fb026e9

Please sign in to comment.