forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 5.0-sync-master
This commit is contained in:
@@ -1 +1,5 @@
|
||||
5.0.0-SNAPSHOT
|
||||
<<<<<<< HEAD
|
||||
5.0.0-SNAPSHOT
|
||||
=======
|
||||
4.3.1-SNAPSHOT
|
||||
>>>>>>> origin/master
|
||||
|
||||
2183
samples/client/petstore/java/okhttp-gson/api/openapi.yaml
Normal file
2183
samples/client/petstore/java/okhttp-gson/api/openapi.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -52,7 +52,7 @@ if(hasProperty('target') && target == 'android') {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
provided 'javax.annotation:jsr250-api:1.0'
|
||||
provided 'javax.annotation:javax.annotation-api:1.3.2'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,15 +98,15 @@ if(hasProperty('target') && target == 'android') {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'io.swagger:swagger-annotations:1.5.22'
|
||||
compile 'io.swagger:swagger-annotations:1.5.24'
|
||||
compile "com.google.code.findbugs:jsr305:3.0.2"
|
||||
compile 'com.squareup.okhttp3:okhttp:3.14.2'
|
||||
compile 'com.squareup.okhttp3:logging-interceptor:3.14.2'
|
||||
compile 'com.google.code.gson:gson:2.8.5'
|
||||
compile 'io.gsonfire:gson-fire:1.8.3'
|
||||
compile 'com.squareup.okhttp3:okhttp:3.14.7'
|
||||
compile 'com.squareup.okhttp3:logging-interceptor:3.14.7'
|
||||
compile 'com.google.code.gson:gson:2.8.6'
|
||||
compile 'io.gsonfire:gson-fire:1.8.4'
|
||||
compile group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1'
|
||||
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
|
||||
compile 'org.threeten:threetenbp:1.4.0'
|
||||
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
|
||||
compile 'org.threeten:threetenbp:1.4.3'
|
||||
testCompile 'junit:junit:4.13'
|
||||
}
|
||||
|
||||
|
||||
@@ -9,15 +9,16 @@ lazy val root = (project in file(".")).
|
||||
publishArtifact in (Compile, packageDoc) := false,
|
||||
resolvers += Resolver.mavenLocal,
|
||||
libraryDependencies ++= Seq(
|
||||
"io.swagger" % "swagger-annotations" % "1.5.22",
|
||||
"com.squareup.okhttp3" % "okhttp" % "3.14.2",
|
||||
"com.squareup.okhttp3" % "logging-interceptor" % "3.14.2",
|
||||
"com.google.code.gson" % "gson" % "2.8.5",
|
||||
"org.apache.commons" % "commons-lang3" % "3.9",
|
||||
"io.swagger" % "swagger-annotations" % "1.5.24",
|
||||
"com.squareup.okhttp3" % "okhttp" % "3.14.7",
|
||||
"com.squareup.okhttp3" % "logging-interceptor" % "3.14.7",
|
||||
"com.google.code.gson" % "gson" % "2.8.6",
|
||||
"org.apache.commons" % "commons-lang3" % "3.10",
|
||||
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1",
|
||||
"org.threeten" % "threetenbp" % "1.4.0" % "compile",
|
||||
"org.threeten" % "threetenbp" % "1.4.3" % "compile",
|
||||
"io.gsonfire" % "gson-fire" % "1.8.3" % "compile",
|
||||
"javax.annotation" % "jsr250-api" % "1.0" % "compile",
|
||||
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
|
||||
"com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",
|
||||
"junit" % "junit" % "4.13" % "test",
|
||||
"com.novocode" % "junit-interface" % "0.10" % "test"
|
||||
)
|
||||
|
||||
@@ -33,6 +33,20 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
<meminitial>128m</meminitial>
|
||||
<maxmem>512m</maxmem>
|
||||
<compilerArgs>
|
||||
<arg>-Xlint:all</arg>
|
||||
<arg>-J-Xss4m</arg><!-- Compiling the generated JSON.java file may require larger stack size. -->
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
@@ -56,7 +70,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.12</version>
|
||||
<version>3.0.0-M4</version>
|
||||
<configuration>
|
||||
<systemProperties>
|
||||
<property>
|
||||
@@ -66,7 +80,7 @@
|
||||
</systemProperties>
|
||||
<argLine>-Xms512m -Xmx1500m</argLine>
|
||||
<parallel>methods</parallel>
|
||||
<forkMode>pertest</forkMode>
|
||||
<threadCount>10</threadCount>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -135,7 +149,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.4</version>
|
||||
<version>3.1.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
@@ -145,6 +159,7 @@
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<doclint>none</doclint>
|
||||
<tags>
|
||||
<tag>
|
||||
<name>http.response.details</name>
|
||||
@@ -243,7 +258,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>jsr250-api</artifactId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>${javax-annotation-version}</version>
|
||||
</dependency>
|
||||
<!-- test dependencies -->
|
||||
@@ -258,14 +273,13 @@
|
||||
<java.version>1.7</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<gson-fire-version>1.8.3</gson-fire-version>
|
||||
<swagger-core-version>1.5.22</swagger-core-version>
|
||||
<okhttp-version>3.14.2</okhttp-version>
|
||||
<gson-version>2.8.5</gson-version>
|
||||
<commons-lang3-version>3.9</commons-lang3-version>
|
||||
<threetenbp-version>1.4.0</threetenbp-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<javax-annotation-version>1.0</javax-annotation-version>
|
||||
<gson-fire-version>1.8.4</gson-fire-version>
|
||||
<swagger-core-version>1.5.24</swagger-core-version>
|
||||
<okhttp-version>3.14.7</okhttp-version>
|
||||
<gson-version>2.8.6</gson-version>
|
||||
<commons-lang3-version>3.10</commons-lang3-version>
|
||||
<threetenbp-version>1.4.3</threetenbp-version>
|
||||
<javax-annotation-version>1.3.2</javax-annotation-version>
|
||||
<junit-version>4.13</junit-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
@@ -32,6 +32,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.net.URI;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.security.GeneralSecurityException;
|
||||
@@ -85,6 +86,7 @@ public class ApiClient {
|
||||
*/
|
||||
public ApiClient() {
|
||||
init();
|
||||
initHttpClient();
|
||||
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||
@@ -113,25 +115,58 @@ public class ApiClient {
|
||||
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters
|
||||
*/
|
||||
public ApiClient(String clientId, String clientSecret, Map<String, String> parameters) {
|
||||
init();
|
||||
this(null, clientId, clientSecret, parameters);
|
||||
}
|
||||
|
||||
RetryingOAuth retryingOAuth = new RetryingOAuth("", clientId, OAuthFlow.implicit, clientSecret, parameters);
|
||||
/*
|
||||
* Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters
|
||||
*/
|
||||
public ApiClient(String basePath, String clientId, String clientSecret, Map<String, String> parameters) {
|
||||
init();
|
||||
if (basePath != null) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
|
||||
String tokenUrl = "";
|
||||
if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) {
|
||||
URI uri = URI.create(getBasePath());
|
||||
tokenUrl = uri.getScheme() + ":" +
|
||||
(uri.getAuthority() != null ? "//" + uri.getAuthority() : "") +
|
||||
tokenUrl;
|
||||
if (!URI.create(tokenUrl).isAbsolute()) {
|
||||
throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL");
|
||||
}
|
||||
}
|
||||
RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.implicit, clientSecret, parameters);
|
||||
authentications.put(
|
||||
"petstore_auth",
|
||||
retryingOAuth
|
||||
);
|
||||
httpClient.interceptors().add(retryingOAuth);
|
||||
initHttpClient(Collections.<Interceptor>singletonList(retryingOAuth));
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||
authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
|
||||
authentications.put("http_basic_test", new HttpBasicAuth());
|
||||
|
||||
// Prevent the authentications from being modified.
|
||||
authentications = Collections.unmodifiableMap(authentications);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
private void initHttpClient() {
|
||||
initHttpClient(Collections.<Interceptor>emptyList());
|
||||
}
|
||||
|
||||
private void initHttpClient(List<Interceptor> interceptors) {
|
||||
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||
builder.addNetworkInterceptor(getProgressInterceptor());
|
||||
for (Interceptor interceptor: interceptors) {
|
||||
builder.addInterceptor(interceptor);
|
||||
}
|
||||
|
||||
httpClient = builder.build();
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
verifyingSsl = true;
|
||||
|
||||
json = new JSON();
|
||||
|
||||
@@ -55,11 +55,11 @@ public class JSON {
|
||||
.registerTypeSelector(Animal.class, new TypeSelector() {
|
||||
@Override
|
||||
public Class getClassForElement(JsonElement readElement) {
|
||||
Map classByDiscriminatorValue = new HashMap();
|
||||
classByDiscriminatorValue.put("Dog".toUpperCase(Locale.ROOT), Dog.class);
|
||||
classByDiscriminatorValue.put("Cat".toUpperCase(Locale.ROOT), Cat.class);
|
||||
classByDiscriminatorValue.put("BigCat".toUpperCase(Locale.ROOT), BigCat.class);
|
||||
classByDiscriminatorValue.put("Animal".toUpperCase(Locale.ROOT), Animal.class);
|
||||
Map<String, Class> classByDiscriminatorValue = new HashMap<String, Class>();
|
||||
classByDiscriminatorValue.put("Dog", Dog.class);
|
||||
classByDiscriminatorValue.put("Cat", Cat.class);
|
||||
classByDiscriminatorValue.put("BigCat", BigCat.class);
|
||||
classByDiscriminatorValue.put("Animal", Animal.class);
|
||||
return getClassByDiscriminator(classByDiscriminatorValue,
|
||||
getDiscriminatorValue(readElement, "className"));
|
||||
}
|
||||
@@ -77,8 +77,15 @@ public class JSON {
|
||||
return element.getAsString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Java class that implements the OpenAPI schema for the specified discriminator value.
|
||||
*
|
||||
* @param classByDiscriminatorValue The map of discriminator values to Java classes.
|
||||
* @param discriminatorValue The value of the OpenAPI discriminator in the input data.
|
||||
* @return The Java class that implements the OpenAPI schema
|
||||
*/
|
||||
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
|
||||
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase(Locale.ROOT));
|
||||
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue);
|
||||
if (null == clazz) {
|
||||
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Representing a Server configuration.
|
||||
*/
|
||||
public class ServerConfiguration {
|
||||
public String URL;
|
||||
public String description;
|
||||
public Map<String, ServerVariable> variables;
|
||||
|
||||
/**
|
||||
* @param URL A URL to the target host.
|
||||
* @param description A describtion of the host designated by the URL.
|
||||
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
||||
*/
|
||||
public ServerConfiguration(String URL, String description, Map<String, ServerVariable> variables) {
|
||||
this.URL = URL;
|
||||
this.description = description;
|
||||
this.variables = variables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format URL template using given variables.
|
||||
*
|
||||
* @param variables A map between a variable name and its value.
|
||||
* @return Formatted URL.
|
||||
*/
|
||||
public String URL(Map<String, String> variables) {
|
||||
String url = this.URL;
|
||||
|
||||
// go through variables and replace placeholders
|
||||
for (Map.Entry<String, ServerVariable> variable: this.variables.entrySet()) {
|
||||
String name = variable.getKey();
|
||||
ServerVariable serverVariable = variable.getValue();
|
||||
String value = serverVariable.defaultValue;
|
||||
|
||||
if (variables != null && variables.containsKey(name)) {
|
||||
value = variables.get(name);
|
||||
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
|
||||
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
|
||||
}
|
||||
}
|
||||
url = url.replaceAll("\\{" + name + "\\}", value);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format URL template using default server variables.
|
||||
*
|
||||
* @return Formatted URL.
|
||||
*/
|
||||
public String URL() {
|
||||
return URL(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Representing a Server Variable for server URL template substitution.
|
||||
*/
|
||||
public class ServerVariable {
|
||||
public String description;
|
||||
public String defaultValue;
|
||||
public HashSet<String> enumValues = null;
|
||||
|
||||
/**
|
||||
* @param description A description for the server variable.
|
||||
* @param defaultValue The default value to use for substitution.
|
||||
* @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
|
||||
*/
|
||||
public ServerVariable(String description, String defaultValue, HashSet<String> enumValues) {
|
||||
this.description = description;
|
||||
this.defaultValue = defaultValue;
|
||||
this.enumValues = enumValues;
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,13 @@ public class RetryingOAuth extends OAuth implements Interceptor {
|
||||
this(new OkHttpClient(), tokenRequestBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
@param tokenUrl The token URL to be used for this OAuth2 flow.
|
||||
Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode".
|
||||
The value must be an absolute URL.
|
||||
@param clientId The OAuth2 client ID for the "clientCredentials" flow.
|
||||
@param clientSecret The OAuth2 client secret for the "clientCredentials" flow.
|
||||
*/
|
||||
public RetryingOAuth(
|
||||
String tokenUrl,
|
||||
String clientId,
|
||||
|
||||
@@ -28,9 +28,12 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
@@ -42,12 +45,16 @@ import static org.junit.Assert.*;
|
||||
public class PetApiTest {
|
||||
|
||||
private PetApi api = new PetApi();
|
||||
private static final Logger LOG = LoggerFactory.getLogger(PetApiTest.class);
|
||||
// In the circle.yml file, /etc/host is configured with an entry to resolve petstore.swagger.io to 127.0.0.1
|
||||
private static String basePath = "http://petstore.swagger.io:80/v2";
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
// setup authentication
|
||||
ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key");
|
||||
apiKeyAuth.setApiKey("special-key");
|
||||
api.getApiClient().setBasePath(basePath);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -55,7 +62,7 @@ public class PetApiTest {
|
||||
// the default api client is used
|
||||
assertEquals(Configuration.getDefaultApiClient(), api.getApiClient());
|
||||
assertNotNull(api.getApiClient());
|
||||
assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath());
|
||||
assertEquals(basePath, api.getApiClient().getBasePath());
|
||||
assertFalse(api.getApiClient().isDebugging());
|
||||
|
||||
ApiClient oldClient = api.getApiClient();
|
||||
@@ -74,7 +81,7 @@ public class PetApiTest {
|
||||
// set api client via setter method
|
||||
api.setApiClient(oldClient);
|
||||
assertNotNull(api.getApiClient());
|
||||
assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath());
|
||||
assertEquals(basePath, api.getApiClient().getBasePath());
|
||||
assertFalse(api.getApiClient().isDebugging());
|
||||
}
|
||||
|
||||
@@ -85,6 +92,7 @@ public class PetApiTest {
|
||||
|
||||
Pet fetched = api.getPetById(pet.getId());
|
||||
assertPetMatches(pet, fetched);
|
||||
api.deletePet(pet.getId(), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -98,6 +106,7 @@ public class PetApiTest {
|
||||
Pet fetched = resp.getData();
|
||||
|
||||
assertPetMatches(pet, fetched);
|
||||
api.deletePet(pet.getId(), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -144,6 +153,7 @@ public class PetApiTest {
|
||||
}
|
||||
} while (result.isEmpty());
|
||||
assertPetMatches(pet, fetched);
|
||||
api.deletePet(pet.getId(), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -197,6 +207,7 @@ public class PetApiTest {
|
||||
assertEquals(404, exception.getCode());
|
||||
assertEquals("Not Found", exception.getMessage());
|
||||
assertEquals("application/json", exception.getResponseHeaders().get("Content-Type").get(0));
|
||||
api.deletePet(pet.getId(), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -255,26 +266,31 @@ public class PetApiTest {
|
||||
final ApiException exception = getCallback3.getException();
|
||||
assertNotNull(exception);
|
||||
assertEquals(404, exception.getCode());
|
||||
api.deletePet(pet1.getId(), null);
|
||||
api.deletePet(pet2.getId(), null);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testUpdatePet() throws Exception {
|
||||
Pet pet = createPet();
|
||||
api.addPet(pet);
|
||||
pet.setName("programmer");
|
||||
|
||||
api.updatePet(pet);
|
||||
|
||||
Pet fetched = api.getPetById(pet.getId());
|
||||
assertPetMatches(pet, fetched);
|
||||
api.deletePet(pet.getId(), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindPetsByStatus() throws Exception {
|
||||
assertEquals(basePath, api.getApiClient().getBasePath());
|
||||
Pet pet = createPet();
|
||||
api.addPet(pet);
|
||||
pet.setName("programmer");
|
||||
pet.setStatus(Pet.StatusEnum.PENDING);
|
||||
|
||||
api.updatePet(pet);
|
||||
|
||||
List<Pet> pets = api.findPetsByStatus(Arrays.asList("pending"));
|
||||
@@ -335,6 +351,7 @@ public class PetApiTest {
|
||||
Pet updated = api.getPetById(fetched.getId());
|
||||
|
||||
assertEquals(updated.getName(), "furt");
|
||||
api.deletePet(pet.getId(), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -343,12 +360,13 @@ public class PetApiTest {
|
||||
api.addPet(pet);
|
||||
|
||||
Pet fetched = api.getPetById(pet.getId());
|
||||
api.deletePet(fetched.getId(), null);
|
||||
api.deletePet(pet.getId(), null);
|
||||
|
||||
try {
|
||||
fetched = api.getPetById(fetched.getId());
|
||||
fail("expected an error");
|
||||
} catch (ApiException e) {
|
||||
LOG.info("Code: {}. Message: {}", e.getCode(), e.getMessage());
|
||||
assertEquals(404, e.getCode());
|
||||
}
|
||||
}
|
||||
@@ -364,6 +382,7 @@ public class PetApiTest {
|
||||
writer.close();
|
||||
|
||||
api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath()));
|
||||
api.deletePet(pet.getId(), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -396,7 +415,7 @@ public class PetApiTest {
|
||||
|
||||
private Pet createPet() {
|
||||
Pet pet = new Pet();
|
||||
pet.setId(1234567L);
|
||||
pet.setId(ThreadLocalRandom.current().nextLong(Long.MAX_VALUE));
|
||||
pet.setName("gorilla");
|
||||
|
||||
Category category = new Category();
|
||||
|
||||
Reference in New Issue
Block a user