forked from loafle/openapi-generator-original
add more tests such as empty response (#14587)
This commit is contained in:
@@ -44,4 +44,33 @@ public interface BodyApi extends ApiClient.Api {
|
||||
ApiResponse<Pet> testEchoBodyPetWithHttpInfo(Pet pet);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Test empty response body
|
||||
* Test empty response body
|
||||
* @param pet Pet object that needs to be added to the store (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("POST /echo/body/Pet/response_string")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testEchoBodyPetResponseString(Pet pet);
|
||||
|
||||
/**
|
||||
* Test empty response body
|
||||
* Similar to <code>testEchoBodyPetResponseString</code> but it also returns the http response headers .
|
||||
* Test empty response body
|
||||
* @param pet Pet object that needs to be added to the store (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("POST /echo/body/Pet/response_string")
|
||||
@Headers({
|
||||
"Content-Type: application/json",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testEchoBodyPetResponseStringWithHttpInfo(Pet pet);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.EncodingUtils;
|
||||
import org.openapitools.client.model.ApiResponse;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import feign.*;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public interface FormApi extends ApiClient.Api {
|
||||
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
* Test form parameter(s)
|
||||
* @param integerForm (optional)
|
||||
* @param booleanForm (optional)
|
||||
* @param stringForm (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("POST /form/integer/boolean/string")
|
||||
@Headers({
|
||||
"Content-Type: application/x-www-form-urlencoded",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testFormIntegerBooleanString(@Param("integer_form") Integer integerForm, @Param("boolean_form") Boolean booleanForm, @Param("string_form") String stringForm);
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
* Similar to <code>testFormIntegerBooleanString</code> but it also returns the http response headers .
|
||||
* Test form parameter(s)
|
||||
* @param integerForm (optional)
|
||||
* @param booleanForm (optional)
|
||||
* @param stringForm (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("POST /form/integer/boolean/string")
|
||||
@Headers({
|
||||
"Content-Type: application/x-www-form-urlencoded",
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testFormIntegerBooleanStringWithHttpInfo(@Param("integer_form") Integer integerForm, @Param("boolean_form") Boolean booleanForm, @Param("string_form") String stringForm);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.EncodingUtils;
|
||||
import org.openapitools.client.model.ApiResponse;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import feign.*;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public interface HeaderApi extends ApiClient.Api {
|
||||
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
* Test header parameter(s)
|
||||
* @param integerHeader (optional)
|
||||
* @param booleanHeader (optional)
|
||||
* @param stringHeader (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /header/integer/boolean/string")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
"integer_header: {integerHeader}",
|
||||
|
||||
"boolean_header: {booleanHeader}",
|
||||
|
||||
"string_header: {stringHeader}"
|
||||
})
|
||||
String testHeaderIntegerBooleanString(@Param("integerHeader") Integer integerHeader, @Param("booleanHeader") Boolean booleanHeader, @Param("stringHeader") String stringHeader);
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
* Similar to <code>testHeaderIntegerBooleanString</code> but it also returns the http response headers .
|
||||
* Test header parameter(s)
|
||||
* @param integerHeader (optional)
|
||||
* @param booleanHeader (optional)
|
||||
* @param stringHeader (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("GET /header/integer/boolean/string")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
"integer_header: {integerHeader}",
|
||||
|
||||
"boolean_header: {booleanHeader}",
|
||||
|
||||
"string_header: {stringHeader}"
|
||||
})
|
||||
ApiResponse<String> testHeaderIntegerBooleanStringWithHttpInfo(@Param("integerHeader") Integer integerHeader, @Param("booleanHeader") Boolean booleanHeader, @Param("stringHeader") String stringHeader);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* API tests for FormApi
|
||||
*/
|
||||
class FormApiTest {
|
||||
|
||||
private FormApi api;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
api = new ApiClient().buildClient(FormApi.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test form parameter(s)
|
||||
*
|
||||
* Test form parameter(s)
|
||||
*/
|
||||
@Test
|
||||
void testFormIntegerBooleanStringTest() {
|
||||
Integer integerForm = null;
|
||||
Boolean booleanForm = null;
|
||||
String stringForm = null;
|
||||
// String response = api.testFormIntegerBooleanString(integerForm, booleanForm, stringForm);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* API tests for HeaderApi
|
||||
*/
|
||||
class HeaderApiTest {
|
||||
|
||||
private HeaderApi api;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
api = new ApiClient().buildClient(HeaderApi.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test header parameter(s)
|
||||
*
|
||||
* Test header parameter(s)
|
||||
*/
|
||||
@Test
|
||||
void testHeaderIntegerBooleanStringTest() {
|
||||
Integer integerHeader = null;
|
||||
Boolean booleanHeader = null;
|
||||
String stringHeader = null;
|
||||
// String response = api.testHeaderIntegerBooleanString(integerHeader, booleanHeader, stringHeader);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user