forked from loafle/openapi-generator-original
upgrade okhttp-gson and google-api-client to junit5 (#18668)
* upgrade okhttp-gson and google-api-client to junit5 * add changes in StringUtilTest * use https instead of http to fix 301 (moved) error * revert petstore test server url to http://petstore.swagger.io and regenerate samples * synced gradle/sbt/pom, re-generated samples * revert removal of port 80 from test url * udpate google api client tests * update sha * update comment --------- Co-authored-by: Thorsten Hirsch <t.hirsch@web.de>
This commit is contained in:
@@ -118,9 +118,9 @@ dependencies {
|
||||
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
|
||||
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
|
||||
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
|
||||
testImplementation 'org.mockito:mockito-core:3.12.4'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
|
||||
}
|
||||
|
||||
javadoc {
|
||||
|
||||
@@ -22,7 +22,7 @@ lazy val root = (project in file(".")).
|
||||
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
|
||||
"com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",
|
||||
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
|
||||
"org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test",
|
||||
"org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test",
|
||||
"com.novocode" % "junit-interface" % "0.10" % "test",
|
||||
"org.mockito" % "mockito-core" % "3.12.4" % "test"
|
||||
)
|
||||
|
||||
@@ -339,7 +339,7 @@
|
||||
<commons-lang3-version>3.14.0</commons-lang3-version>
|
||||
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
|
||||
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
|
||||
<junit-version>5.10.0</junit-version>
|
||||
<junit-version>5.10.2</junit-version>
|
||||
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
|
||||
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
|
||||
<jsr311-api-version>1.1.1</jsr311-api-version>
|
||||
|
||||
@@ -117,9 +117,9 @@ dependencies {
|
||||
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
|
||||
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
|
||||
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
|
||||
testImplementation 'org.mockito:mockito-core:3.12.4'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
|
||||
}
|
||||
|
||||
javadoc {
|
||||
|
||||
@@ -21,7 +21,7 @@ lazy val root = (project in file(".")).
|
||||
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
|
||||
"com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",
|
||||
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
|
||||
"org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test",
|
||||
"org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test",
|
||||
"com.novocode" % "junit-interface" % "0.10" % "test",
|
||||
"org.mockito" % "mockito-core" % "3.12.4" % "test"
|
||||
)
|
||||
|
||||
@@ -334,7 +334,7 @@
|
||||
<commons-lang3-version>3.14.0</commons-lang3-version>
|
||||
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
|
||||
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
|
||||
<junit-version>5.10.0</junit-version>
|
||||
<junit-version>5.10.2</junit-version>
|
||||
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
|
||||
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
|
||||
<jsr311-api-version>1.1.1</jsr311-api-version>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
package org.openapitools.client;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.api.*;
|
||||
import org.openapitools.client.model.*;
|
||||
@@ -46,13 +46,13 @@ public class CustomTest {
|
||||
photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category"));
|
||||
|
||||
Pet p = bodyApi.testEchoBodyPet(queryObject);
|
||||
Assert.assertNotNull(p);
|
||||
Assert.assertEquals("Hello World", p.getName());
|
||||
Assert.assertEquals(Long.valueOf(12345L), p.getId());
|
||||
Assertions.assertNotNull(p);
|
||||
Assertions.assertEquals("Hello World", p.getName());
|
||||
Assertions.assertEquals(Long.valueOf(12345L), p.getId());
|
||||
|
||||
// response is empty body
|
||||
Pet p2 = bodyApi.testEchoBodyPet(null);
|
||||
Assert.assertNull(p2);
|
||||
Assertions.assertNull(p2);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ public class CustomTest {
|
||||
|
||||
String response = api.testQueryStyleFormExplodeTrueObject(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com", p.path);
|
||||
Assertions.assertEquals("/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com", p.path);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +88,7 @@ public class CustomTest {
|
||||
|
||||
String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", p.path);
|
||||
Assertions.assertEquals("/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", p.path);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,7 +106,7 @@ public class CustomTest {
|
||||
|
||||
String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_deepObject/explode_true/object/allOf?query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World", p.path);
|
||||
Assertions.assertEquals("/query/style_deepObject/explode_true/object/allOf?query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World", p.path);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,6 +124,6 @@ public class CustomTest {
|
||||
|
||||
String response = api.testQueryStyleFormExplodeTrueArrayString(q);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path);
|
||||
Assertions.assertEquals("/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
||||
Reference in New Issue
Block a user