Skip to content

Commit 7e5c163

Browse files
gracekarinafrantuma
authored andcommitted
adding samples generated -refs #9203
1 parent 558fd2e commit 7e5c163

File tree

153 files changed

+619
-565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+619
-565
lines changed

modules/swagger-codegen/src/test/java/io/swagger/codegen/v3/service/GeneratorServiceTest.java

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void testGeneratorService_Jaxrs_cxf_cdi() throws IOException {
7070

7171
}
7272

73-
@Test(description = "test generator service with jaxrs-cxf-cdi")
73+
@Test(description = "test generator service with jaxrs-resteasy-eap")
7474
public void testGeneratorService_Jaxrs_resteasy_eap() throws IOException {
7575

7676
String path = getTmpFolder().getAbsolutePath();
@@ -95,7 +95,7 @@ public void testGeneratorService_Jaxrs_resteasy_eap() throws IOException {
9595
}
9696
}
9797

98-
@Test(description = "test generator service with jaxrs-cxf-cdi")
98+
@Test(description = "test generator service with jaxrs-resteasy")
9999
public void testGeneratorService_Jaxrs_resteasy() throws IOException {
100100

101101
String path = getTmpFolder().getAbsolutePath();
@@ -120,7 +120,7 @@ public void testGeneratorService_Jaxrs_resteasy() throws IOException {
120120
}
121121
}
122122

123-
@Test(description = "test generator service with jaxrs-cxf-cdi")
123+
@Test(description = "test generator service with jaxrs-spec")
124124
public void testGeneratorService_Jaxrs_spec() throws IOException {
125125

126126
String path = getTmpFolder().getAbsolutePath();
@@ -145,7 +145,7 @@ public void testGeneratorService_Jaxrs_spec() throws IOException {
145145
}
146146
}
147147

148-
@Test(description = "test generator service with jaxrs-cxf-cdi")
148+
@Test(description = "test generator service with spring")
149149
public void testGeneratorService_JavaSpring() throws IOException {
150150

151151
String path = getTmpFolder().getAbsolutePath();
@@ -170,6 +170,31 @@ public void testGeneratorService_JavaSpring() throws IOException {
170170
}
171171
}
172172

173+
@Test(description = "test generator service with spring")
174+
public void testGeneratorService_JavaSpringPetStore() throws IOException {
175+
176+
String path = getTmpFolder().getAbsolutePath();
177+
GenerationRequest request = new GenerationRequest();
178+
request
179+
.codegenVersion(GenerationRequest.CodegenVersion.V3)
180+
.type(GenerationRequest.Type.SERVER)
181+
.lang("spring")
182+
.spec(loadSpecAsNode("2_0/petstore.yaml", true, true))
183+
.options(
184+
new Options()
185+
.outputDir(path)
186+
);
187+
188+
List<File> files = new GeneratorService().generationRequest(request).generate();
189+
Assert.assertFalse(files.isEmpty());
190+
for (File f: files) {
191+
String relPath = f.getAbsolutePath().substring(path.length());
192+
if ("/src/main/java/io/swagger/model/Order.java".equals(relPath)) {
193+
Assert.assertTrue(FileUtils.readFileToString(f).contains("isComplete"));
194+
}
195+
}
196+
}
197+
173198
@Test(description = "test generator service with java 3.0")
174199
public void testGeneratorServiceJava3() {
175200

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.6-SNAPSHOT
1+
3.0.12-SNAPSHOT

samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/PetApi.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public interface PetApi {
5050
@Operation(summary = "Deletes a pet", tags={ })
5151
@ApiResponses(value = {
5252
@ApiResponse(responseCode = "400", description = "Invalid pet value") })
53-
public void deletePet(@PathParam("petId") Integer petId, @HeaderParam("api_key") String apiKey);
53+
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey);
5454

5555
/**
5656
* Finds Pets by status
@@ -96,7 +96,7 @@ public interface PetApi {
9696
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Pet.class))),
9797
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
9898
@ApiResponse(responseCode = "404", description = "Pet not found") })
99-
public Pet getPetById(@PathParam("petId") Integer petId);
99+
public Pet getPetById(@PathParam("petId") Long petId);
100100

101101
/**
102102
* Update an existing pet
@@ -122,7 +122,7 @@ public interface PetApi {
122122
@Operation(summary = "Updates a pet in the store with form data", tags={ })
123123
@ApiResponses(value = {
124124
@ApiResponse(responseCode = "405", description = "Invalid input") })
125-
public void updatePetWithForm(@PathParam("petId") Integer petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
125+
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status);
126126

127127
/**
128128
* uploads an image
@@ -135,5 +135,5 @@ public interface PetApi {
135135
@Operation(summary = "uploads an image", tags={ })
136136
@ApiResponses(value = {
137137
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = ModelApiResponse.class))) })
138-
public ModelApiResponse uploadFile(@PathParam("petId") Integer petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail);
138+
public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail);
139139
}

samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/api/StoreApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public interface StoreApi {
6969
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Order.class))),
7070
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
7171
@ApiResponse(responseCode = "404", description = "Order not found") })
72-
public Order getOrderById(@PathParam("orderId") Integer orderId);
72+
public Order getOrderById(@PathParam("orderId") Long orderId);
7373

7474
/**
7575
* Place an order for a pet

samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Category.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* A category for a pet
1919
**/
2020
@Schema(description="A category for a pet")
21-
public class Category {
21+
public class Category {
2222

2323
@Schema(description = "")
2424
private Long id = null;

samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/ModelApiResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Describes the result of uploading an image resource
1919
**/
2020
@Schema(description="Describes the result of uploading an image resource")
21-
public class ModelApiResponse {
21+
public class ModelApiResponse {
2222

2323
@Schema(description = "")
2424
private Integer code = null;

samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Order.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* An order for a pets from the pet store
2020
**/
2121
@Schema(description="An order for a pets from the pet store")
22-
public class Order {
22+
public class Order {
2323

2424
@Schema(description = "")
2525
private Long id = null;
@@ -167,7 +167,7 @@ public Order status(StatusEnum status) {
167167
* @return complete
168168
**/
169169
@JsonProperty("complete")
170-
public Boolean isisComplete() {
170+
public Boolean isComplete() {
171171
return complete;
172172
}
173173

samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Pet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* A pet for sale in the pet store
2323
**/
2424
@Schema(description="A pet for sale in the pet store")
25-
public class Pet {
25+
public class Pet {
2626

2727
@Schema(description = "")
2828
private Long id = null;

samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/Tag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* A tag for a pet
1919
**/
2020
@Schema(description="A tag for a pet")
21-
public class Tag {
21+
public class Tag {
2222

2323
@Schema(description = "")
2424
private Long id = null;

samples/client/petstore/jaxrs-cxf-client/src/gen/java/io/swagger/model/User.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* A User who is purchasing from the pet store
1919
**/
2020
@Schema(description="A User who is purchasing from the pet store")
21-
public class User {
21+
public class User {
2222

2323
@Schema(description = "")
2424
private Long id = null;

0 commit comments

Comments
 (0)