mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 10:35:25 +00:00
add petstore sample for jaxrs-cxf-client, update travis ci (#5111)
This commit is contained in:
parent
2048defe7b
commit
6c2304ace5
31
bin/jaxrs-cxf-client-petstore.sh
Executable file
31
bin/jaxrs-cxf-client-petstore.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate --artifact-id "jaxrs-cxf-petstore-client" -t modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/ -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-cxf -o samples/client/petstore/jaxrs-cxf-client/"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
10
bin/windows/jaxrs-cxf-client-petstore.bat
Executable file
10
bin/windows/jaxrs-cxf-client-petstore.bat
Executable file
@ -0,0 +1,10 @@
|
||||
set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate --artifact-id "jaxrs-cxf-client-petstore-client" -i modules\swagger-codegen\src\test\resources\2_0\petstore.json -l jaxrs-cxf-client -o samples\client\petstore\jaxrs-cxf-client
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
3
pom.xml
3
pom.xml
@ -755,8 +755,6 @@
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<!-- run ruby test first which has a random delay script to
|
||||
avoid issues with running 2 CI jobs in parallel. -->
|
||||
<!-- clients -->
|
||||
<module>samples/client/petstore/akka-scala</module>
|
||||
<module>samples/client/petstore/ruby</module>
|
||||
@ -771,6 +769,7 @@
|
||||
<module>samples/client/petstore/java/retrofit</module>
|
||||
<module>samples/client/petstore/java/retrofit2</module>
|
||||
<module>samples/client/petstore/java/retrofit2rx</module>
|
||||
<module>samples/client/petstore/jaxrs-cxf-client</module>
|
||||
<module>samples/client/petstore/javascript</module>
|
||||
<module>samples/client/petstore/python</module>
|
||||
<module>samples/client/petstore/scala</module>
|
||||
|
@ -0,0 +1,25 @@
|
||||
# Swagger Codegen Ignore
|
||||
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
|
||||
**/impl/*
|
198
samples/client/petstore/jaxrs-cxf-client/pom.xml
Normal file
198
samples/client/petstore/jaxrs-cxf-client/pom.xml
Normal file
@ -0,0 +1,198 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>jaxrs-cxf-petstore-client</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>jaxrs-cxf-petstore-client</name>
|
||||
<version>1.0.0</version>
|
||||
<build>
|
||||
<sourceDirectory>src/main/java</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!--plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>${jetty-version}</version>
|
||||
<configuration>
|
||||
<webApp>
|
||||
<contextPath>/</contextPath>
|
||||
</webApp>
|
||||
<webAppSourceDirectory>target/${project.artifactId}-${project.version}</webAppSourceDirectory>
|
||||
<stopPort>8079</stopPort>
|
||||
<stopKey>stopit</stopKey>
|
||||
<httpConnector>
|
||||
<port>8080</port>
|
||||
<idleTimeout>60000</idleTimeout>
|
||||
</httpConnector>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>start-jetty</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>start</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<scanIntervalSeconds>0</scanIntervalSeconds>
|
||||
<daemon>true</daemon>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>stop-jetty</id>
|
||||
<phase>post-integration-test</phase>
|
||||
<goals>
|
||||
<goal>stop</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin-->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-source</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>src/gen/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- build WAR file -->
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-jaxrs</artifactId>
|
||||
<scope>compile</scope>
|
||||
<version>${swagger-core-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>${logback-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-core</artifactId>
|
||||
<version>${logback-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- Bean Validation API support -->
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>${beanvalidation-version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- CXF Client -->
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-rs-client</artifactId>
|
||||
<version>${cxf-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- CXF server -->
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
|
||||
<version>${cxf-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-rs-service-description</artifactId>
|
||||
<version>${cxf-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-rs-service-description-swagger</artifactId>
|
||||
<version>${cxf-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-ws-policy</artifactId>
|
||||
<version>${cxf-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-wsdl</artifactId>
|
||||
<version>${cxf-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
||||
<artifactId>jackson-jaxrs-json-provider</artifactId>
|
||||
<version>${jackson-jaxrs-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-joda</artifactId>
|
||||
<version>${jackson-jaxrs-version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>sonatype-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<java.version>1.7</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<swagger-core-version>1.5.12</swagger-core-version>
|
||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||
<jersey2-version>2.22.2</jersey2-version>
|
||||
<junit-version>4.12</junit-version>
|
||||
<logback-version>1.1.7</logback-version>
|
||||
<servlet-api-version>2.5</servlet-api-version>
|
||||
<beanvalidation-version>1.1.0.Final</beanvalidation-version>
|
||||
<cxf-version>3.1.8</cxf-version>
|
||||
<jackson-jaxrs-version>2.8.4</jackson-jaxrs-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
</project>
|
@ -0,0 +1,101 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
import io.swagger.model.Pet;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.jaxrs.PATCH;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Path("/")
|
||||
@Api(value = "/", description = "")
|
||||
public interface PetApi {
|
||||
|
||||
@POST
|
||||
@Path("/pet")
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Add a new pet to the store", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
public void addPet(Pet body);
|
||||
|
||||
@DELETE
|
||||
@Path("/pet/{petId}")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Deletes a pet", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid pet value") })
|
||||
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
|
||||
|
||||
@GET
|
||||
@Path("/pet/findByStatus")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Finds Pets by status", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
@ApiResponse(code = 400, message = "Invalid status value") })
|
||||
public List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status);
|
||||
|
||||
@GET
|
||||
@Path("/pet/findByTags")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Finds Pets by tags", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
@ApiResponse(code = 400, message = "Invalid tag value") })
|
||||
public List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags);
|
||||
|
||||
@GET
|
||||
@Path("/pet/{petId}")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Find pet by ID", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found") })
|
||||
public Pet getPetById(@PathParam("petId") Long petId);
|
||||
|
||||
@PUT
|
||||
@Path("/pet")
|
||||
@Consumes({ "application/json", "application/xml" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Update an existing pet", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Pet not found"),
|
||||
@ApiResponse(code = 405, message = "Validation exception") })
|
||||
public void updatePet(Pet body);
|
||||
|
||||
@POST
|
||||
@Path("/pet/{petId}")
|
||||
@Consumes({ "application/x-www-form-urlencoded" })
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 405, message = "Invalid input") })
|
||||
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
|
||||
|
||||
@POST
|
||||
@Path("/pet/{petId}/uploadImage")
|
||||
@Consumes({ "multipart/form-data" })
|
||||
@Produces({ "application/json" })
|
||||
@ApiOperation(value = "uploads an image", tags={ "pet" })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
|
||||
public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail);
|
||||
}
|
||||
|
@ -0,0 +1,62 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import java.util.Map;
|
||||
import io.swagger.model.Order;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.jaxrs.PATCH;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Path("/")
|
||||
@Api(value = "/", description = "")
|
||||
public interface StoreApi {
|
||||
|
||||
@DELETE
|
||||
@Path("/store/order/{orderId}")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Delete purchase order by ID", tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Order not found") })
|
||||
public void deleteOrder(@PathParam("orderId") String orderId);
|
||||
|
||||
@GET
|
||||
@Path("/store/inventory")
|
||||
@Produces({ "application/json" })
|
||||
@ApiOperation(value = "Returns pet inventories by status", tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
|
||||
public Map<String, Integer> getInventory();
|
||||
|
||||
@GET
|
||||
@Path("/store/order/{orderId}")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Find purchase order by ID", tags={ "store", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid ID supplied"),
|
||||
@ApiResponse(code = 404, message = "Order not found") })
|
||||
public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId);
|
||||
|
||||
@POST
|
||||
@Path("/store/order")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Place an order for a pet", tags={ "store" })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||
@ApiResponse(code = 400, message = "Invalid Order") })
|
||||
public Order placeOrder(Order body);
|
||||
}
|
||||
|
@ -0,0 +1,95 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.model.User;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.jaxrs.PATCH;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Path("/")
|
||||
@Api(value = "/", description = "")
|
||||
public interface UserApi {
|
||||
|
||||
@POST
|
||||
@Path("/user")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Create user", tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
public void createUser(User body);
|
||||
|
||||
@POST
|
||||
@Path("/user/createWithArray")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Creates list of users with given input array", tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
public void createUsersWithArrayInput(List<User> body);
|
||||
|
||||
@POST
|
||||
@Path("/user/createWithList")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Creates list of users with given input array", tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
public void createUsersWithListInput(List<User> body);
|
||||
|
||||
@DELETE
|
||||
@Path("/user/{username}")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Delete user", tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied"),
|
||||
@ApiResponse(code = 404, message = "User not found") })
|
||||
public void deleteUser(@PathParam("username") String username);
|
||||
|
||||
@GET
|
||||
@Path("/user/{username}")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Get user by user name", tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = User.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username supplied"),
|
||||
@ApiResponse(code = 404, message = "User not found") })
|
||||
public User getUserByName(@PathParam("username") String username);
|
||||
|
||||
@GET
|
||||
@Path("/user/login")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Logs user into the system", tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = String.class),
|
||||
@ApiResponse(code = 400, message = "Invalid username/password supplied") })
|
||||
public String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password);
|
||||
|
||||
@GET
|
||||
@Path("/user/logout")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Logs out current logged in user session", tags={ "user", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation") })
|
||||
public void logoutUser();
|
||||
|
||||
@PUT
|
||||
@Path("/user/{username}")
|
||||
@Produces({ "application/xml", "application/json" })
|
||||
@ApiOperation(value = "Updated user", tags={ "user" })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 400, message = "Invalid user supplied"),
|
||||
@ApiResponse(code = 404, message = "User not found") })
|
||||
public void updateUser(@PathParam("username") String username, User body);
|
||||
}
|
||||
|
@ -0,0 +1,80 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlEnumValue;
|
||||
|
||||
@ApiModel(description="A category for a pet")
|
||||
public class Category {
|
||||
|
||||
@ApiModelProperty(value = "")
|
||||
private Long id = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private String name = null;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Category id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Category name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Category {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,100 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlEnumValue;
|
||||
|
||||
@ApiModel(description="Describes the result of uploading an image resource")
|
||||
public class ModelApiResponse {
|
||||
|
||||
@ApiModelProperty(value = "")
|
||||
private Integer code = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private String type = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private String message = null;
|
||||
|
||||
/**
|
||||
* Get code
|
||||
* @return code
|
||||
**/
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public ModelApiResponse code(Integer code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
**/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public ModelApiResponse type(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get message
|
||||
* @return message
|
||||
**/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public ModelApiResponse message(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelApiResponse {\n");
|
||||
|
||||
sb.append(" code: ").append(toIndentedString(code)).append("\n");
|
||||
sb.append(" type: ").append(toIndentedString(type)).append("\n");
|
||||
sb.append(" message: ").append(toIndentedString(message)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,194 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import java.util.Date;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlEnumValue;
|
||||
|
||||
@ApiModel(description="An order for a pets from the pet store")
|
||||
public class Order {
|
||||
|
||||
@ApiModelProperty(value = "")
|
||||
private Long id = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private Long petId = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private Integer quantity = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private Date shipDate = null;
|
||||
|
||||
@XmlType(name="StatusEnum")
|
||||
@XmlEnum(String.class)
|
||||
public enum StatusEnum {
|
||||
|
||||
@XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered"));
|
||||
|
||||
|
||||
private String value;
|
||||
|
||||
StatusEnum (String v) {
|
||||
value = v;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
public static StatusEnum fromValue(String v) {
|
||||
for (StatusEnum b : StatusEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(v)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
private StatusEnum status = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private Boolean complete = false;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Order id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get petId
|
||||
* @return petId
|
||||
**/
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
|
||||
public void setPetId(Long petId) {
|
||||
this.petId = petId;
|
||||
}
|
||||
|
||||
public Order petId(Long petId) {
|
||||
this.petId = petId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get quantity
|
||||
* @return quantity
|
||||
**/
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Order quantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shipDate
|
||||
* @return shipDate
|
||||
**/
|
||||
public Date getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
|
||||
public void setShipDate(Date shipDate) {
|
||||
this.shipDate = shipDate;
|
||||
}
|
||||
|
||||
public Order shipDate(Date shipDate) {
|
||||
this.shipDate = shipDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
* @return status
|
||||
**/
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(StatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Order status(StatusEnum status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get complete
|
||||
* @return complete
|
||||
**/
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
||||
public void setComplete(Boolean complete) {
|
||||
this.complete = complete;
|
||||
}
|
||||
|
||||
public Order complete(Boolean complete) {
|
||||
this.complete = complete;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Order {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" petId: ").append(toIndentedString(petId)).append("\n");
|
||||
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
|
||||
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" complete: ").append(toIndentedString(complete)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,209 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.model.Category;
|
||||
import io.swagger.model.Tag;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlEnumValue;
|
||||
|
||||
@ApiModel(description="A pet for sale in the pet store")
|
||||
public class Pet {
|
||||
|
||||
@ApiModelProperty(value = "")
|
||||
private Long id = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private Category category = null;
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
private String name = null;
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
@ApiModelProperty(value = "")
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
|
||||
@XmlType(name="StatusEnum")
|
||||
@XmlEnum(String.class)
|
||||
public enum StatusEnum {
|
||||
|
||||
@XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold"));
|
||||
|
||||
|
||||
private String value;
|
||||
|
||||
StatusEnum (String v) {
|
||||
value = v;
|
||||
}
|
||||
|
||||
public String value() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
public static StatusEnum fromValue(String v) {
|
||||
for (StatusEnum b : StatusEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(v)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
private StatusEnum status = null;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Pet id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get category
|
||||
* @return category
|
||||
**/
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(Category category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public Pet category(Category category) {
|
||||
this.category = category;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@NotNull
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Pet name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
@NotNull
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
|
||||
public void setPhotoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
public Pet photoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Pet addPhotoUrlsItem(String photoUrlsItem) {
|
||||
this.photoUrls.add(photoUrlsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public Pet tags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Pet addTagsItem(Tag tagsItem) {
|
||||
this.tags.add(tagsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
* @return status
|
||||
**/
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(StatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Pet status(StatusEnum status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Pet {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" category: ").append(toIndentedString(category)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,80 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlEnumValue;
|
||||
|
||||
@ApiModel(description="A tag for a pet")
|
||||
public class Tag {
|
||||
|
||||
@ApiModelProperty(value = "")
|
||||
private Long id = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private String name = null;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Tag id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Tag name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Tag {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,200 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.XmlEnum;
|
||||
import javax.xml.bind.annotation.XmlEnumValue;
|
||||
|
||||
@ApiModel(description="A User who is purchasing from the pet store")
|
||||
public class User {
|
||||
|
||||
@ApiModelProperty(value = "")
|
||||
private Long id = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private String username = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private String firstName = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private String lastName = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private String email = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private String password = null;
|
||||
@ApiModelProperty(value = "")
|
||||
private String phone = null;
|
||||
@ApiModelProperty(value = "User Status")
|
||||
private Integer userStatus = null;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public User id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get username
|
||||
* @return username
|
||||
**/
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public User username(String username) {
|
||||
this.username = username;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get firstName
|
||||
* @return firstName
|
||||
**/
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public User firstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lastName
|
||||
* @return lastName
|
||||
**/
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public User lastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get email
|
||||
* @return email
|
||||
**/
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public User email(String email) {
|
||||
this.email = email;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get password
|
||||
* @return password
|
||||
**/
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public User password(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get phone
|
||||
* @return phone
|
||||
**/
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public User phone(String phone) {
|
||||
this.phone = phone;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* User Status
|
||||
* @return userStatus
|
||||
**/
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
||||
public void setUserStatus(Integer userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
}
|
||||
|
||||
public User userStatus(Integer userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class User {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" username: ").append(toIndentedString(username)).append("\n");
|
||||
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
|
||||
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
|
||||
sb.append(" email: ").append(toIndentedString(email)).append("\n");
|
||||
sb.append(" password: ").append(toIndentedString(password)).append("\n");
|
||||
sb.append(" phone: ").append(toIndentedString(phone)).append("\n");
|
||||
sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,71 @@
|
||||
package io.swagger.api.impl;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
import io.swagger.model.Pet;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.apache.cxf.jaxrs.model.wadl.Description;
|
||||
import org.apache.cxf.jaxrs.model.wadl.DocTarget;
|
||||
|
||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
public class PetApiServiceImpl implements PetApi {
|
||||
public void addPet(Pet body) {
|
||||
// TODO: Implement...
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void deletePet(Long petId, String apiKey) {
|
||||
// TODO: Implement...
|
||||
|
||||
|
||||
}
|
||||
|
||||
public List<Pet> findPetsByStatus(List<String> status) {
|
||||
// TODO: Implement...
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Pet> findPetsByTags(List<String> tags) {
|
||||
// TODO: Implement...
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Pet getPetById(Long petId) {
|
||||
// TODO: Implement...
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void updatePet(Pet body) {
|
||||
// TODO: Implement...
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void updatePetWithForm(Long petId, String name, String status) {
|
||||
// TODO: Implement...
|
||||
|
||||
|
||||
}
|
||||
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Attachment fileDetail) {
|
||||
// TODO: Implement...
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
package io.swagger.api.impl;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import java.util.Map;
|
||||
import io.swagger.model.Order;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.apache.cxf.jaxrs.model.wadl.Description;
|
||||
import org.apache.cxf.jaxrs.model.wadl.DocTarget;
|
||||
|
||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
public class StoreApiServiceImpl implements StoreApi {
|
||||
public void deleteOrder(String orderId) {
|
||||
// TODO: Implement...
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Map<String, Integer> getInventory() {
|
||||
// TODO: Implement...
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Order getOrderById(Long orderId) {
|
||||
// TODO: Implement...
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Order placeOrder(Order body) {
|
||||
// TODO: Implement...
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
package io.swagger.api.impl;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import java.util.List;
|
||||
import io.swagger.model.User;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.apache.cxf.jaxrs.model.wadl.Description;
|
||||
import org.apache.cxf.jaxrs.model.wadl.DocTarget;
|
||||
|
||||
import org.apache.cxf.jaxrs.ext.multipart.*;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
public class UserApiServiceImpl implements UserApi {
|
||||
public void createUser(User body) {
|
||||
// TODO: Implement...
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void createUsersWithArrayInput(List<User> body) {
|
||||
// TODO: Implement...
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void createUsersWithListInput(List<User> body) {
|
||||
// TODO: Implement...
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void deleteUser(String username) {
|
||||
// TODO: Implement...
|
||||
|
||||
|
||||
}
|
||||
|
||||
public User getUserByName(String username) {
|
||||
// TODO: Implement...
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String loginUser(String username, String password) {
|
||||
// TODO: Implement...
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void logoutUser() {
|
||||
// TODO: Implement...
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void updateUser(String username, User body) {
|
||||
// TODO: Implement...
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,221 @@
|
||||
/**
|
||||
* Swagger Petstore
|
||||
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package io.swagger.api;
|
||||
|
||||
import java.io.File;
|
||||
import io.swagger.model.ModelApiResponse;
|
||||
import io.swagger.model.Pet;
|
||||
import org.junit.Test;
|
||||
import org.junit.Before;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
|
||||
import org.apache.cxf.jaxrs.client.ClientConfiguration;
|
||||
import org.apache.cxf.jaxrs.client.WebClient;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API tests for PetApi
|
||||
*/
|
||||
public class PetApiTest {
|
||||
|
||||
|
||||
private PetApi api;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
JacksonJsonProvider provider = new JacksonJsonProvider();
|
||||
List providers = new ArrayList();
|
||||
providers.add(provider);
|
||||
|
||||
api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", PetApi.class, providers);
|
||||
org.apache.cxf.jaxrs.client.Client client = WebClient.client(api);
|
||||
|
||||
ClientConfiguration config = WebClient.getConfig(client);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void addPetTest() {
|
||||
Pet body = null;
|
||||
//api.addPet(body);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void deletePetTest() {
|
||||
Long petId = null;
|
||||
String apiKey = null;
|
||||
//api.deletePet(petId, apiKey);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
*
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void findPetsByStatusTest() {
|
||||
List<String> status = null;
|
||||
//List<Pet> response = api.findPetsByStatus(status);
|
||||
//assertNotNull(response);
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
*
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void findPetsByTagsTest() {
|
||||
List<String> tags = null;
|
||||
//List<Pet> response = api.findPetsByTags(tags);
|
||||
//assertNotNull(response);
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Find pet by ID
|
||||
*
|
||||
* Returns a single pet
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void getPetByIdTest() {
|
||||
Long petId = null;
|
||||
//Pet response = api.getPetById(petId);
|
||||
//assertNotNull(response);
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void updatePetTest() {
|
||||
Pet body = null;
|
||||
//api.updatePet(body);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void updatePetWithFormTest() {
|
||||
Long petId = null;
|
||||
String name = null;
|
||||
String status = null;
|
||||
//api.updatePetWithForm(petId, name, status);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void uploadFileTest() {
|
||||
Long petId = null;
|
||||
String additionalMetadata = null;
|
||||
org.apache.cxf.jaxrs.ext.multipart.Attachment file = null;
|
||||
//ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file);
|
||||
//assertNotNull(response);
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,142 @@
|
||||
/**
|
||||
* Swagger Petstore
|
||||
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package io.swagger.api;
|
||||
|
||||
import java.util.Map;
|
||||
import io.swagger.model.Order;
|
||||
import org.junit.Test;
|
||||
import org.junit.Before;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
|
||||
import org.apache.cxf.jaxrs.client.ClientConfiguration;
|
||||
import org.apache.cxf.jaxrs.client.WebClient;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API tests for StoreApi
|
||||
*/
|
||||
public class StoreApiTest {
|
||||
|
||||
|
||||
private StoreApi api;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
JacksonJsonProvider provider = new JacksonJsonProvider();
|
||||
List providers = new ArrayList();
|
||||
providers.add(provider);
|
||||
|
||||
api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", StoreApi.class, providers);
|
||||
org.apache.cxf.jaxrs.client.Client client = WebClient.client(api);
|
||||
|
||||
ClientConfiguration config = WebClient.getConfig(client);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
*
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void deleteOrderTest() {
|
||||
String orderId = null;
|
||||
//api.deleteOrder(orderId);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
*
|
||||
* Returns a map of status codes to quantities
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void getInventoryTest() {
|
||||
//Map<String, Integer> response = api.getInventory();
|
||||
//assertNotNull(response);
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
*
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void getOrderByIdTest() {
|
||||
Long orderId = null;
|
||||
//Order response = api.getOrderById(orderId);
|
||||
//assertNotNull(response);
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void placeOrderTest() {
|
||||
Order body = null;
|
||||
//Order response = api.placeOrder(body);
|
||||
//assertNotNull(response);
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,216 @@
|
||||
/**
|
||||
* Swagger Petstore
|
||||
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package io.swagger.api;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.model.User;
|
||||
import org.junit.Test;
|
||||
import org.junit.Before;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
|
||||
import org.apache.cxf.jaxrs.client.ClientConfiguration;
|
||||
import org.apache.cxf.jaxrs.client.WebClient;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API tests for UserApi
|
||||
*/
|
||||
public class UserApiTest {
|
||||
|
||||
|
||||
private UserApi api;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
JacksonJsonProvider provider = new JacksonJsonProvider();
|
||||
List providers = new ArrayList();
|
||||
providers.add(provider);
|
||||
|
||||
api = JAXRSClientFactory.create("http://petstore.swagger.io/v2", UserApi.class, providers);
|
||||
org.apache.cxf.jaxrs.client.Client client = WebClient.client(api);
|
||||
|
||||
ClientConfiguration config = WebClient.getConfig(client);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create user
|
||||
*
|
||||
* This can only be done by the logged in user.
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void createUserTest() {
|
||||
User body = null;
|
||||
//api.createUser(body);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void createUsersWithArrayInputTest() {
|
||||
List<User> body = null;
|
||||
//api.createUsersWithArrayInput(body);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void createUsersWithListInputTest() {
|
||||
List<User> body = null;
|
||||
//api.createUsersWithListInput(body);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
*
|
||||
* This can only be done by the logged in user.
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void deleteUserTest() {
|
||||
String username = null;
|
||||
//api.deleteUser(username);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void getUserByNameTest() {
|
||||
String username = null;
|
||||
//User response = api.getUserByName(username);
|
||||
//assertNotNull(response);
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void loginUserTest() {
|
||||
String username = null;
|
||||
String password = null;
|
||||
//String response = api.loginUser(username, password);
|
||||
//assertNotNull(response);
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void logoutUserTest() {
|
||||
//api.logoutUser();
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
*
|
||||
* This can only be done by the logged in user.
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void updateUserTest() {
|
||||
String username = null;
|
||||
User body = null;
|
||||
//api.updateUser(username, body);
|
||||
|
||||
// TODO: test validations
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user