diff --git a/samples/client/echo_api/java/restclient/.openapi-generator/FILES b/samples/client/echo_api/java/restclient/.openapi-generator/FILES index 045decee44eeb..0ca8c0874363c 100644 --- a/samples/client/echo_api/java/restclient/.openapi-generator/FILES +++ b/samples/client/echo_api/java/restclient/.openapi-generator/FILES @@ -60,3 +60,21 @@ src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +src/test/java/org/openapitools/client/api/AuthApiTest.java +src/test/java/org/openapitools/client/api/BodyApiTest.java +src/test/java/org/openapitools/client/api/FormApiTest.java +src/test/java/org/openapitools/client/api/HeaderApiTest.java +src/test/java/org/openapitools/client/api/PathApiTest.java +src/test/java/org/openapitools/client/api/QueryApiTest.java +src/test/java/org/openapitools/client/model/BirdTest.java +src/test/java/org/openapitools/client/model/CategoryTest.java +src/test/java/org/openapitools/client/model/DataQueryTest.java +src/test/java/org/openapitools/client/model/DefaultValueTest.java +src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java +src/test/java/org/openapitools/client/model/PetTest.java +src/test/java/org/openapitools/client/model/QueryTest.java +src/test/java/org/openapitools/client/model/StringEnumRefTest.java +src/test/java/org/openapitools/client/model/TagTest.java +src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java +src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java +src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/AuthApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/AuthApiTest.java index e258cc91dbd1f..3d8b19258ce0e 100644 --- a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/AuthApiTest.java +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/AuthApiTest.java @@ -13,50 +13,46 @@ package org.openapitools.client.api; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -import org.junit.Test; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * API tests for AuthApi */ +@Disabled public class AuthApiTest { private final AuthApi api = new AuthApi(); + /** * To test HTTP basic authentication * - *
To test HTTP basic authentication + * To test HTTP basic authentication */ @Test - public void testAuthHttpBasicTest() { - // given - api.getApiClient().setUsername("test_user"); - api.getApiClient().setPassword("test_password"); - - // when + public void testAuthHttpBasicTest() { String response = api.testAuthHttpBasic(); - assertThat( - response, - containsString("Authorization: Basic dGVzdF91c2VyOnRlc3RfcGFzc3dvcmQ=")); + // TODO: test validations } - + /** * To test HTTP bearer authentication * - *
To test HTTP bearer authentication + * To test HTTP bearer authentication */ @Test - public void testAuthHttpBearerTest() { - // given - api.getApiClient().setBearerToken("test_token"); - - // when + public void testAuthHttpBearerTest() { String response = api.testAuthHttpBearer(); - assertThat(response, containsString("Authorization: Bearer test_token")); + // TODO: test validations } + } \ No newline at end of file diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/BodyApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/BodyApiTest.java index 42145cd9d3b2e..4c26e99503813 100644 --- a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/BodyApiTest.java +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/BodyApiTest.java @@ -10,278 +10,158 @@ * Do not edit the class manually. */ -package org.openapitools.client.api; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.hamcrest.MatcherAssert.assertThat; +package org.openapitools.client.api; import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.Test; -import org.openapitools.client.ApiClient; -import org.openapitools.client.GifHttpMessageConverter; -import org.openapitools.client.OctetStreamHttpMessageConverter; -import org.openapitools.client.model.Category; import org.openapitools.client.model.Pet; -import org.openapitools.client.model.Pet.StatusEnum; import org.openapitools.client.model.StringEnumRef; import org.openapitools.client.model.Tag; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -/** API tests for BodyApi */ -public class BodyApiTest { - - private final BodyApi api = new BodyApi(); - - /** - * Test binary (gif) response body - * - *
Test binary (gif) response body - */ - @Test - public void testBinaryGifTest() throws IOException { - // given - var restClient = - ApiClient.buildRestClientBuilder() - .messageConverters(converters -> converters.add(new GifHttpMessageConverter())) - .build(); - api.setApiClient(new ApiClient(restClient)); - - // when - File response = api.testBinaryGif(); - - // then - assertThat(response, notNullValue()); - assertThat(response.exists(), is(true)); - assertThat(Files.probeContentType(response.toPath()), is("image/gif")); - } - - /** - * Test body parameter(s) - * - *
Test body parameter(s) - */ - @Test - public void testBodyApplicationOctetstreamBinaryTest() throws IOException { - // given - var restClient = - ApiClient.buildRestClientBuilder() - .messageConverters(converters -> converters.add(new OctetStreamHttpMessageConverter())) - .build(); - api.setApiClient(new ApiClient(restClient)); - - var tempFile = Files.createTempFile("test", ".txt"); - Files.writeString(tempFile, "test123"); - - File body = tempFile.toFile(); - - // when - String response = api.testBodyApplicationOctetstreamBinary(body); - - // then - assertThat(response, containsString("Content-Type: application/octet-stream")); - assertThat(response, containsString("test123")); - } - - /** - * Test array of binary in multipart mime - * - *
Test array of binary in multipart mime
- */
- @Test
- public void testBodyMultipartFormdataArrayOfBinaryTest() throws IOException {
- // given
- var firstFile = Files.createTempFile("test", ".txt");
- String firstFileContent = "Thanks for using OpenAPI generator :)";
- Files.writeString(firstFile, firstFileContent);
-
- var secondFile = Files.createTempFile("test2", ".txt");
- String secondFileContent = "Your ad could be here";
- Files.writeString(secondFile, secondFileContent);
-
- List Test single binary in multipart mime
- */
- @Test
- public void testBodyMultipartFormdataSingleBinaryTest() throws IOException {
- // given
- var testFile = Files.createTempFile("test", ".txt");
- String testFileContent = "Lorem ipsum dolor sit amet";
- Files.writeString(testFile, testFileContent);
-
- // when
- String response = api.testBodyMultipartFormdataSingleBinary(testFile.toFile());
-
- // then
- assertThat(response, containsString("Content-Type: multipart/form-data"));
- assertThat(response, containsString(testFileContent));
- }
-
- /**
- * Test body parameter(s)
- *
- * Test body parameter(s)
- */
- @Test
- public void testEchoBodyAllOfPetTest() {
- // given
- // The content length must be set to disable the Transfer-Encoding: chunked which would lead to
- // unparsable response because the echo server is replying them as body.
- api.getApiClient().addDefaultHeader("Content-Length", "192");
-
- Pet pet =
- new Pet()
- .id(42L)
- .name("Corgi")
- .category(new Category().id(1L).name("Dogs"))
- .status(StatusEnum.SOLD)
- .addPhotoUrlsItem(
- "https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg")
- .addTagsItem(new Tag().id(1L).name("cute"));
-
- // when
- Pet response = api.testEchoBodyAllOfPet(pet);
-
- // then
- assertThat(response, is(pet));
- }
-
- /**
- * Test free form object
- *
- * Test free form object
- */
- @Test
- public void testEchoBodyFreeFormObjectResponseStringTest() {
- // given
- // The content length must be set to disable the Transfer-Encoding: chunked which would lead to
- // unparsable response because the echo server is replying them as body.
- api.getApiClient().addDefaultHeader("Content-Length", "51");
-
- Object mapAsObject =
- new HashMap<>(
- Map.of(
- "firstKey", "firstValue",
- "secondKey", "secondValue"));
-
- // when
- String response = api.testEchoBodyFreeFormObjectResponseString(mapAsObject);
-
- // then
- assertThat(response, is("{\"firstKey\":\"firstValue\",\"secondKey\":\"secondValue\"}"));
- }
-
- /**
- * Test body parameter(s)
- *
- * Test body parameter(s)
- */
- @Test
- public void testEchoBodyPetTest() {
- // given
- // The content length must be set to disable the Transfer-Encoding: chunked which would lead to
- // unparsable response because the echo server is replying them as body.
- api.getApiClient().addDefaultHeader("Content-Length", "192");
-
- Pet pet =
- new Pet()
- .id(42L)
- .name("Corgi")
- .category(new Category().id(1L).name("Dogs"))
- .status(StatusEnum.SOLD)
- .addPhotoUrlsItem(
- "https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg")
- .addTagsItem(new Tag().id(1L).name("cute"));
-
- // when
- Pet response = api.testEchoBodyPet(pet);
-
- // then
- assertThat(response, is(pet));
- }
-
- /**
- * Test empty response body
- *
- * Test empty response body
- */
- @Test
- public void testEchoBodyPetResponseStringTest() {
- // given
- // The content length must be set to disable the Transfer-Encoding: chunked which would lead to
- // unparsable response because the echo server is replying them as body.
- api.getApiClient().addDefaultHeader("Content-Length", "192");
-
- Pet pet =
- new Pet()
- .id(42L)
- .name("Corgi")
- .category(new Category().id(1L).name("Dogs"))
- .status(StatusEnum.SOLD)
- .addPhotoUrlsItem(
- "https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg")
- .addTagsItem(new Tag().id(1L).name("cute"));
-
- // when
- String response = api.testEchoBodyPetResponseString(pet);
-
- // then
- assertThat(
- response,
- is(
- "{\"id\":42,\"name\":\"Corgi\",\"category\":{\"id\":1,\"name\":\"Dogs\"},\"photoUrls\":[\"https://cdn.pixabay.com/photo/2021/10/13/09/01/corgi-6705821_1280.jpg\"],\"tags\":[{\"id\":1,\"name\":\"cute\"}],\"status\":\"sold\"}"));
- }
-
- /**
- * Test string enum response body
- *
- * Test string enum response body
- */
- @Test
- public void testEchoBodyStringEnumTest() {
- // given
- String body = "\"failure\"";
-
- // when
- StringEnumRef response = api.testEchoBodyStringEnum(body);
-
- // then
- assertThat(response, is(StringEnumRef.FAILURE));
- }
-
- /**
- * Test empty json (request body)
- *
- * Test empty json (request body)
- */
- @Test
- public void testEchoBodyTagResponseStringTest() {
- // given
- Tag tag = null;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
- // when
- String response = api.testEchoBodyTagResponseString(tag);
+/**
+ * API tests for BodyApi
+ */
+@Disabled
+public class BodyApiTest {
- // then
- assertThat(response, nullValue());
- }
-}
+ private final BodyApi api = new BodyApi();
+
+
+ /**
+ * Test binary (gif) response body
+ *
+ * Test binary (gif) response body
+ */
+ @Test
+ public void testBinaryGifTest() {
+ File response = api.testBinaryGif();
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test body parameter(s)
+ *
+ * Test body parameter(s)
+ */
+ @Test
+ public void testBodyApplicationOctetstreamBinaryTest() {
+ File body = null;
+ String response = api.testBodyApplicationOctetstreamBinary(body);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test array of binary in multipart mime
+ *
+ * Test array of binary in multipart mime
+ */
+ @Test
+ public void testBodyMultipartFormdataArrayOfBinaryTest() {
+ List Test form parameter(s)
- */
- @Test
- public void testFormIntegerBooleanStringTest() {
- // Given
- // The content length must be set to disable the Transfer-Encoding: chunked which would lead to
- // unparsable response because the echo server is replying them as body.
- api.getApiClient().addDefaultHeader("Content-Length", "53");
-
- Integer integerForm = 42;
- Boolean booleanForm = true;
- String stringForm = "Test123";
-
- // When
- String response = api.testFormIntegerBooleanString(integerForm, booleanForm, stringForm);
-
- // Then
- assertThat(response, containsString("integer_form=42&boolean_form=true&string_form=Test123"));
- }
-
- /**
- * Test form parameter(s) for multipart schema
- *
- * Test form parameter(s) for multipart schema
- */
- @Test
- public void testFormObjectMultipartTest() {
- // Given
- TestFormObjectMultipartRequestMarker marker =
- new TestFormObjectMultipartRequestMarker().name("Test Marker");
-
- // When
- String response = api.testFormObjectMultipart(marker);
-
- // Then
- assertThat(response, containsString("{\"name\":\"Test Marker\"}"));
- }
-
- /**
- * Test form parameter(s) for oneOf schema with only the first parameters filled
- *
- * Test form parameter(s) for oneOf schema
- */
- @Test
- public void testFormOneofTest_first() {
- // Given
- String form1 = "test12";
- Integer form2 = 12;
-
- String form3 = null;
- Boolean form4 = null;
-
- Long id = null;
- String name = null;
-
- // When
- String response = api.testFormOneof(form1, form2, form3, form4, id, name);
-
- // Then
- assertThat(response, containsString("form1=test12&form2=12"));
- }
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
- /**
- * Test form parameter(s) for oneOf schema with only the second parameters filled
- *
- * Test form parameter(s) for oneOf schema
- */
- @Test
- public void testFormOneofTest_second() {
- // Given
- String form1 = null;
- Integer form2 = null;
-
- String form3 = "34test";
- Boolean form4 = false;
-
- Long id = null;
- String name = null;
-
- // When
- String response = api.testFormOneof(form1, form2, form3, form4, id, name);
-
- // Then
- assertThat(response, containsString("form3=34test&form4=false"));
- }
-
- /**
- * Test form parameter(s) for oneOf schema with only the third parameters filled
- *
- * Test form parameter(s) for oneOf schema
- */
- @Test
- public void testFormOneofTest_third() {
- // Given
- String form1 = null;
- Integer form2 = null;
-
- String form3 = null;
- Boolean form4 = null;
-
- Long id = 21L;
- String name = "Hans";
-
- // When
- String response = api.testFormOneof(form1, form2, form3, form4, id, name);
-
- // Then
- assertThat(response, containsString("id=21&name=Hans"));
- }
-
- /**
- * Test form parameter(s) for oneOf schema with all parameters filled
- *
- * Test form parameter(s) for oneOf schema
- */
- @Test
- public void testFormOneofTest_all() {
- // Given
- String form1 = "test12";
- Integer form2 = 12;
-
- String form3 = "34test";
- Boolean form4 = false;
-
- Long id = 21L;
- String name = "Hans";
-
- // When
- String response = api.testFormOneof(form1, form2, form3, form4, id, name);
+/**
+ * API tests for FormApi
+ */
+@Disabled
+public class FormApiTest {
- // Then
- assertThat(
- response, containsString("form1=test12&form2=12&form3=34test&form4=false&id=21&name=Hans"));
- }
-}
+ private final FormApi api = new FormApi();
+
+
+ /**
+ * Test form parameter(s)
+ *
+ * Test form parameter(s)
+ */
+ @Test
+ public void testFormIntegerBooleanStringTest() {
+ Integer integerForm = null;
+ Boolean booleanForm = null;
+ String stringForm = null;
+ String response = api.testFormIntegerBooleanString(integerForm, booleanForm, stringForm);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test form parameter(s) for multipart schema
+ *
+ * Test form parameter(s) for multipart schema
+ */
+ @Test
+ public void testFormObjectMultipartTest() {
+ TestFormObjectMultipartRequestMarker marker = null;
+ String response = api.testFormObjectMultipart(marker);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test form parameter(s) for oneOf schema
+ *
+ * Test form parameter(s) for oneOf schema
+ */
+ @Test
+ public void testFormOneofTest() {
+ String form1 = null;
+ Integer form2 = null;
+ String form3 = null;
+ Boolean form4 = null;
+ Long id = null;
+ String name = null;
+ String response = api.testFormOneof(form1, form2, form3, form4, id, name);
+
+ // TODO: test validations
+ }
+
+}
\ No newline at end of file
diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java
index c0230e6b003df..a8f1764c216fd 100644
--- a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java
+++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java
@@ -10,51 +10,43 @@
* Do not edit the class manually.
*/
-package org.openapitools.client.api;
-import static org.hamcrest.CoreMatchers.allOf;
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.MatcherAssert.assertThat;
+package org.openapitools.client.api;
-import org.junit.Test;
import org.openapitools.client.model.StringEnumRef;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
-/** API tests for HeaderApi */
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * API tests for HeaderApi
+ */
+@Disabled
public class HeaderApiTest {
- private final HeaderApi api = new HeaderApi();
-
- /**
- * Test header parameter(s)
- *
- * Test header parameter(s)
- */
- @Test
- public void testHeaderIntegerBooleanStringEnumsTest() {
- // Given
- Integer integerHeader = 11;
- Boolean booleanHeader = true;
- String stringHeader = "simple String Header";
- String enumNonrefStringHeader = "false";
- StringEnumRef enumRefStringHeader = StringEnumRef.UNCLASSIFIED;
-
- // When
- String response =
- api.testHeaderIntegerBooleanStringEnums(
- integerHeader,
- booleanHeader,
- stringHeader,
- enumNonrefStringHeader,
- enumRefStringHeader);
-
- // Then
- assertThat(
- response,
- allOf(
- containsString("integer_header: 11"),
- containsString("boolean_header: true"),
- containsString("string_header: simple String Header"),
- containsString("enum_nonref_string_header: false"),
- containsString("enum_ref_string_header: unclassified")));
- }
-}
+ private final HeaderApi api = new HeaderApi();
+
+
+ /**
+ * Test header parameter(s)
+ *
+ * Test header parameter(s)
+ */
+ @Test
+ public void testHeaderIntegerBooleanStringEnumsTest() {
+ Integer integerHeader = null;
+ Boolean booleanHeader = null;
+ String stringHeader = null;
+ String enumNonrefStringHeader = null;
+ StringEnumRef enumRefStringHeader = null;
+ String response = api.testHeaderIntegerBooleanStringEnums(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader);
+
+ // TODO: test validations
+ }
+
+}
\ No newline at end of file
diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/PathApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/PathApiTest.java
index d9381c9c2f3e2..9605fe30aeb6f 100644
--- a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/PathApiTest.java
+++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/PathApiTest.java
@@ -10,40 +10,42 @@
* Do not edit the class manually.
*/
-package org.openapitools.client.api;
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.MatcherAssert.assertThat;
+package org.openapitools.client.api;
-import org.junit.Test;
import org.openapitools.client.model.StringEnumRef;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
-/** API tests for PathApi */
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * API tests for PathApi
+ */
+@Disabled
public class PathApiTest {
- private final PathApi api = new PathApi();
-
- /**
- * Test path parameter(s)
- *
- * Test path parameter(s)
- */
- @Test
- public void
- testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathTest() {
- // Given
- String pathString = "simple String Path";
- Integer pathInteger = 50;
- String enumNonrefStringPath = "true";
- StringEnumRef enumRefStringPath = StringEnumRef.SUCCESS;
-
- // When
- String response =
- api.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(
- pathString, pathInteger, enumNonrefStringPath, enumRefStringPath);
-
- // Then
- assertThat(
- response, containsString("/path/string/simple%20String%20Path/integer/50/true/success"));
- }
-}
+ private final PathApi api = new PathApi();
+
+
+ /**
+ * Test path parameter(s)
+ *
+ * Test path parameter(s)
+ */
+ @Test
+ public void testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathTest() {
+ String pathString = null;
+ Integer pathInteger = null;
+ String enumNonrefStringPath = null;
+ StringEnumRef enumRefStringPath = null;
+ String response = api.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath);
+
+ // TODO: test validations
+ }
+
+}
\ No newline at end of file
diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/QueryApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/QueryApiTest.java
index 827ef91367e09..d105e6f1fa208 100644
--- a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/QueryApiTest.java
+++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/QueryApiTest.java
@@ -10,206 +10,167 @@
* Do not edit the class manually.
*/
-package org.openapitools.client.api;
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.MatcherAssert.assertThat;
+package org.openapitools.client.api;
-import java.time.Instant;
-import java.time.LocalDate;
-import java.util.List;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
import org.openapitools.client.model.DataQuery;
+import java.time.LocalDate;
+import java.time.Instant;
import org.openapitools.client.model.Pet;
import org.openapitools.client.model.StringEnumRef;
import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter;
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
-/** API tests for QueryApi */
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * API tests for QueryApi
+ */
+@Disabled
public class QueryApiTest {
- private final QueryApi api = new QueryApi();
-
- /**
- * Test query parameter(s)
- *
- * Test query parameter(s)
- */
- @Test
- public void testEnumRefStringTest() {
- // Given
- String enumNonrefStringQuery = "false";
- StringEnumRef enumRefStringQuery = StringEnumRef.SUCCESS;
-
- // When
- String response = api.testEnumRefString(enumNonrefStringQuery, enumRefStringQuery);
-
- // Then
- assertThat(
- response, containsString("?enum_nonref_string_query=false&enum_ref_string_query=success"));
- }
-
- /**
- * Test query parameter(s)
- *
- * Test query parameter(s)
- */
- @Test
- public void testQueryDatetimeDateStringTest() {
- // Given
- Instant datetimeQuery = Instant.ofEpochMilli(1720361075);
- LocalDate dateQuery = LocalDate.of(2024, 7, 7);
- String stringQuery = "2024-07-07T16:05:59Z";
-
- // When
- String response = api.testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery);
-
- // Then
- assertThat(
- response,
- containsString(
- "?datetime_query=1970-01-20T21%3A52%3A41.075Z&date_query=2024-07-07&string_query=2024-07-07T16%3A05%3A59Z"));
- }
-
- /**
- * Test query parameter(s)
- *
- * Test query parameter(s)
- */
- @Test
- public void testQueryIntegerBooleanStringTest() {
- // Given
- Integer integerQuery = 42;
- Boolean booleanQuery = false;
- String stringQuery = "Hello World!";
-
- // When
- String response = api.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery);
-
- // Then
- assertThat(
- response,
- containsString("?integer_query=42&boolean_query=false&string_query=Hello%20World%21"));
- }
-
- /**
- * Test query parameter(s)
- *
- * Test query parameter(s)
- */
- @Test
- @Disabled("The deep object style and the whole dynamic operations are currently not supported")
- public void testQueryStyleDeepObjectExplodeTrueObjectTest() {
- Pet queryObject = null;
- String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject);
-
- // Like Spring WebClient and RestTemplate, the deep object style is currently not
- }
-
- /**
- * Test query parameter(s)
- *
- * Test query parameter(s)
- */
- @Test
- @Disabled("The deep object style and the whole dynamic operations are currently not supported")
- public void testQueryStyleDeepObjectExplodeTrueObjectAllOfTest() {
- TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject = null;
- String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject);
-
- // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic
- // operations are currently not supported
- }
-
- /**
- * Test query parameter(s)
- *
- * Test query parameter(s)
- */
- @Test
- public void testQueryStyleFormExplodeFalseArrayIntegerTest() {
- // Given
- List Test query parameter(s)
- */
- @Test
- public void testQueryStyleFormExplodeFalseArrayStringTest() {
- // Given
- List Test query parameter(s)
- */
- @Test
- @Disabled("The deep object style and the whole dynamic operations are currently not supported")
- public void testQueryStyleFormExplodeTrueArrayStringTest() {
- // Given
- TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject =
- new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter()
- .addValuesItem("Hello")
- .addValuesItem("Hallo")
- .addValuesItem("Bonjour");
-
- // When
- String response = api.testQueryStyleFormExplodeTrueArrayString(queryObject);
-
- // Then
- // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic
- // operations are currently not supported
- assertThat(
- response, containsString("?query_object=Hello&query_object=Hallo&query_object=Bonjour"));
- }
-
- /**
- * Test query parameter(s)
- *
- * Test query parameter(s)
- */
- @Test
- @Disabled("The deep object style and the whole dynamic operations are currently not supported")
- public void testQueryStyleFormExplodeTrueObjectTest() {
- Pet queryObject = null;
- String response = api.testQueryStyleFormExplodeTrueObject(queryObject);
-
- // TODO: test validations
- // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic
- // operations are currently not supported
- }
-
- /**
- * Test query parameter(s)
- *
- * Test query parameter(s)
- */
- @Test
- @Disabled("The deep object style and the whole dynamic operations are currently not supported")
- public void testQueryStyleFormExplodeTrueObjectAllOfTest() {
- DataQuery queryObject = null;
- String response = api.testQueryStyleFormExplodeTrueObjectAllOf(queryObject);
-
- // TODO: test validations
- // Like Spring WebClient and RestTemplate, the deep object style and the whole dynamic
- // operations are currently not supported
- }
-}
+ private final QueryApi api = new QueryApi();
+
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ */
+ @Test
+ public void testEnumRefStringTest() {
+ String enumNonrefStringQuery = null;
+ StringEnumRef enumRefStringQuery = null;
+ String response = api.testEnumRefString(enumNonrefStringQuery, enumRefStringQuery);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ */
+ @Test
+ public void testQueryDatetimeDateStringTest() {
+ Instant datetimeQuery = null;
+ LocalDate dateQuery = null;
+ String stringQuery = null;
+ String response = api.testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ */
+ @Test
+ public void testQueryIntegerBooleanStringTest() {
+ Integer integerQuery = null;
+ Boolean booleanQuery = null;
+ String stringQuery = null;
+ String response = api.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ */
+ @Test
+ public void testQueryStyleDeepObjectExplodeTrueObjectTest() {
+ Pet queryObject = null;
+ String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ */
+ @Test
+ public void testQueryStyleDeepObjectExplodeTrueObjectAllOfTest() {
+ TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject = null;
+ String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ */
+ @Test
+ public void testQueryStyleFormExplodeFalseArrayIntegerTest() {
+ List