Skip to content

Commit

Permalink
udpate google api client tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed May 14, 2024
1 parent 841bbd9 commit c83867e
Show file tree
Hide file tree
Showing 52 changed files with 372 additions and 344 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import java.util.Map;
/**
* API tests for {{classname}}
*/
@Disabled
public class {{classname}}Test {
private final {{classname}} api = new {{classname}}();

{{#operations}}{{#operation}}
{{#operations}}
{{#operation}}
/**
* {{summary}}
*
Expand All @@ -37,9 +37,12 @@ public class {{classname}}Test {
{{#allParams}}
{{{dataType}}} {{paramName}} = null;
{{/allParams}}
{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
// uncomment below to make the test the API function
//{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});

// TODO: test validations
}
{{/operation}}{{/operations}}

{{/operation}}
{{/operations}}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

import org.openapitools.client.model.Client;
import java.util.UUID;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.time.LocalDate;
Expand All @@ -29,12 +29,10 @@
/**
* API tests for AnotherFakeApi
*/
@Disabled
public class AnotherFakeApiTest {

private final AnotherFakeApi api = new AnotherFakeApi();


/**
* To test special tags
*
Expand All @@ -47,9 +45,10 @@ public class AnotherFakeApiTest {
public void call123testSpecialTagsTest() throws IOException {
UUID uuidTest = null;
Client body = null;
Client response = api.call123testSpecialTags(uuidTest, body);
// uncomment below to make the test the API function
//Client response = api.call123testSpecialTags(uuidTest, body);

// TODO: test validations
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.openapitools.client.model.OuterComposite;
import org.openapitools.client.model.User;
import org.openapitools.client.model.XmlItem;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.time.LocalDate;
Expand All @@ -36,12 +36,10 @@
/**
* API tests for FakeApi
*/
@Disabled
public class FakeApiTest {

private final FakeApi api = new FakeApi();


/**
* creates an XmlItem
*
Expand All @@ -53,11 +51,12 @@ public class FakeApiTest {
@Test
public void createXmlItemTest() throws IOException {
XmlItem xmlItem = null;
api.createXmlItem(xmlItem);
// uncomment below to make the test the API function
//api.createXmlItem(xmlItem);

// TODO: test validations
}

/**
*
*
Expand All @@ -69,11 +68,12 @@ public void createXmlItemTest() throws IOException {
@Test
public void fakeOuterBooleanSerializeTest() throws IOException {
Boolean body = null;
Boolean response = api.fakeOuterBooleanSerialize(body);
// uncomment below to make the test the API function
//Boolean response = api.fakeOuterBooleanSerialize(body);

// TODO: test validations
}

/**
*
*
Expand All @@ -85,11 +85,12 @@ public void fakeOuterBooleanSerializeTest() throws IOException {
@Test
public void fakeOuterCompositeSerializeTest() throws IOException {
OuterComposite body = null;
OuterComposite response = api.fakeOuterCompositeSerialize(body);
// uncomment below to make the test the API function
//OuterComposite response = api.fakeOuterCompositeSerialize(body);

// TODO: test validations
}

/**
*
*
Expand All @@ -101,11 +102,12 @@ public void fakeOuterCompositeSerializeTest() throws IOException {
@Test
public void fakeOuterNumberSerializeTest() throws IOException {
BigDecimal body = null;
BigDecimal response = api.fakeOuterNumberSerialize(body);
// uncomment below to make the test the API function
//BigDecimal response = api.fakeOuterNumberSerialize(body);

// TODO: test validations
}

/**
*
*
Expand All @@ -117,11 +119,12 @@ public void fakeOuterNumberSerializeTest() throws IOException {
@Test
public void fakeOuterStringSerializeTest() throws IOException {
String body = null;
String response = api.fakeOuterStringSerialize(body);
// uncomment below to make the test the API function
//String response = api.fakeOuterStringSerialize(body);

// TODO: test validations
}

/**
*
*
Expand All @@ -133,11 +136,12 @@ public void fakeOuterStringSerializeTest() throws IOException {
@Test
public void testBodyWithFileSchemaTest() throws IOException {
FileSchemaTestClass body = null;
api.testBodyWithFileSchema(body);
// uncomment below to make the test the API function
//api.testBodyWithFileSchema(body);

// TODO: test validations
}

/**
*
*
Expand All @@ -150,11 +154,12 @@ public void testBodyWithFileSchemaTest() throws IOException {
public void testBodyWithQueryParamsTest() throws IOException {
String query = null;
User body = null;
api.testBodyWithQueryParams(query, body);
// uncomment below to make the test the API function
//api.testBodyWithQueryParams(query, body);

// TODO: test validations
}

/**
* To test \"client\" model
*
Expand All @@ -166,11 +171,12 @@ public void testBodyWithQueryParamsTest() throws IOException {
@Test
public void testClientModelTest() throws IOException {
Client body = null;
Client response = api.testClientModel(body);
// uncomment below to make the test the API function
//Client response = api.testClientModel(body);

// TODO: test validations
}

/**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*
Expand All @@ -195,11 +201,12 @@ public void testEndpointParametersTest() throws IOException {
OffsetDateTime dateTime = null;
String password = null;
String paramCallback = null;
api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
// uncomment below to make the test the API function
//api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);

// TODO: test validations
}

/**
* To test enum parameters
*
Expand All @@ -218,11 +225,12 @@ public void testEnumParametersTest() throws IOException {
Double enumQueryDouble = null;
List<String> enumFormStringArray = null;
String enumFormString = null;
api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
// uncomment below to make the test the API function
//api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);

// TODO: test validations
}

/**
* Fake endpoint to test group parameters (optional)
*
Expand All @@ -239,11 +247,12 @@ public void testGroupParametersTest() throws IOException {
Integer stringGroup = null;
Boolean booleanGroup = null;
Long int64Group = null;
api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
// uncomment below to make the test the API function
//api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);

// TODO: test validations
}

/**
* test inline additionalProperties
*
Expand All @@ -255,11 +264,12 @@ public void testGroupParametersTest() throws IOException {
@Test
public void testInlineAdditionalPropertiesTest() throws IOException {
Map<String, String> param = null;
api.testInlineAdditionalProperties(param);
// uncomment below to make the test the API function
//api.testInlineAdditionalProperties(param);

// TODO: test validations
}

/**
* test json serialization of form data
*
Expand All @@ -272,11 +282,12 @@ public void testInlineAdditionalPropertiesTest() throws IOException {
public void testJsonFormDataTest() throws IOException {
String param = null;
String param2 = null;
api.testJsonFormData(param, param2);
// uncomment below to make the test the API function
//api.testJsonFormData(param, param2);

// TODO: test validations
}

/**
*
*
Expand All @@ -292,9 +303,10 @@ public void testQueryParameterCollectionFormatTest() throws IOException {
List<String> http = null;
List<String> url = null;
List<String> context = null;
api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context);
// uncomment below to make the test the API function
//api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context);

// TODO: test validations
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
package org.openapitools.client.api;

import org.openapitools.client.model.Client;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.time.LocalDate;
Expand All @@ -28,12 +28,10 @@
/**
* API tests for FakeClassnameTags123Api
*/
@Disabled
public class FakeClassnameTags123ApiTest {

private final FakeClassnameTags123Api api = new FakeClassnameTags123Api();


/**
* To test class name in snake case
*
Expand All @@ -45,9 +43,10 @@ public class FakeClassnameTags123ApiTest {
@Test
public void testClassnameTest() throws IOException {
Client body = null;
Client response = api.testClassname(body);
// uncomment below to make the test the API function
//Client response = api.testClassname(body);

// TODO: test validations
}

}
Loading

0 comments on commit c83867e

Please sign in to comment.