Skip to content

Commit 32b21d2

Browse files
committed
replaced ApiException class on tests files to fix build errors on tests run
1 parent c733e1c commit 32b21d2

File tree

3 files changed

+26
-29
lines changed

3 files changed

+26
-29
lines changed

samples/custom-tests/java/v3/okhttp-gson/PetApiTest.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import com.github.tomakehurst.wiremock.WireMockServer;
1717
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
18-
import io.swagger.client.ApiException;
1918
import io.swagger.client.model.Pet;
2019
import org.junit.AfterClass;
2120
import org.junit.Assert;
@@ -82,10 +81,10 @@ public static void tearDown() {
8281
/**
8382
* Add a new pet to the store
8483
*
85-
* @throws ApiException if the Api call fails
84+
* @throws Exception if the Api call fails
8685
*/
8786
@Test
88-
public void addPetTest() throws ApiException {
87+
public void addPetTest() throws Exception {
8988
Pet body = new Pet()
9089
.id(10L)
9190
.name("doggie")
@@ -99,10 +98,10 @@ public void addPetTest() throws ApiException {
9998
/**
10099
* Deletes a pet
101100
*
102-
* @throws ApiException if the Api call fails
101+
* @throws Exception if the Api call fails
103102
*/
104103
@Test
105-
public void deletePetTest() throws ApiException {
104+
public void deletePetTest() throws Exception {
106105
Long petId = 10L;
107106
String apiKey = "abc123";
108107
api.deletePet(petId, apiKey);
@@ -115,10 +114,10 @@ public void deletePetTest() throws ApiException {
115114
* <p>
116115
* Multiple status values can be provided with comma separated strings
117116
*
118-
* @throws ApiException if the Api call fails
117+
* @throws Exception if the Api call fails
119118
*/
120119
@Test
121-
public void findPetsByStatusTest() throws ApiException {
120+
public void findPetsByStatusTest() throws Exception {
122121
List<Pet> response = api.findPetsByStatus("available");
123122

124123
Assert.assertNotNull(response);
@@ -132,10 +131,10 @@ public void findPetsByStatusTest() throws ApiException {
132131
* <p>
133132
* Returns a single pet
134133
*
135-
* @throws ApiException if the Api call fails
134+
* @throws Exception if the Api call fails
136135
*/
137136
@Test
138-
public void getPetByIdTest() throws ApiException {
137+
public void getPetByIdTest() throws Exception {
139138
Long petId = 10L;
140139
Pet response = api.getPetById(petId);
141140

@@ -149,10 +148,10 @@ public void getPetByIdTest() throws ApiException {
149148
/**
150149
* Update an existing pet
151150
*
152-
* @throws ApiException if the Api call fails
151+
* @throws Exception if the Api call fails
153152
*/
154153
@Test
155-
public void updatePetTest() throws ApiException {
154+
public void updatePetTest() throws Exception {
156155
Pet body = new Pet()
157156
.id(10L)
158157
.name("doggie")

samples/custom-tests/java/v3/okhttp-gson/StoreApiTest.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
package io.swagger.client.api;
1515

16-
import io.swagger.client.ApiException;
1716
import io.swagger.client.model.Order;
1817
import org.junit.Assert;
1918
import org.junit.Test;
@@ -83,11 +82,11 @@ public static void tearDown() {
8382
*
8483
* For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
8584
*
86-
* @throws ApiException
85+
* @throws Exception
8786
* if the Api call fails
8887
*/
8988
@Test
90-
public void deleteOrderTest() throws ApiException {
89+
public void deleteOrderTest() throws Exception {
9190
Long orderId = 10L;
9291
api.deleteOrder(orderId);
9392

@@ -99,11 +98,11 @@ public void deleteOrderTest() throws ApiException {
9998
*
10099
* Returns a map of status codes to quantities
101100
*
102-
* @throws ApiException
101+
* @throws Exception
103102
* if the Api call fails
104103
*/
105104
@Test
106-
public void getInventoryTest() throws ApiException {
105+
public void getInventoryTest() throws Exception {
107106
Map<String, Integer> response = api.getInventory();
108107

109108
Assert.assertNotNull(response);
@@ -117,11 +116,11 @@ public void getInventoryTest() throws ApiException {
117116
*
118117
* For valid response try integer IDs with value &gt;&#x3D; 1 and &lt;&#x3D; 10. Other values will generated exceptions
119118
*
120-
* @throws ApiException
119+
* @throws Exception
121120
* if the Api call fails
122121
*/
123122
@Test
124-
public void getOrderByIdTest() throws ApiException {
123+
public void getOrderByIdTest() throws Exception {
125124
Long orderId = 10L;
126125
Order response = api.getOrderById(orderId);
127126
Assert.assertNotNull(response);
@@ -137,11 +136,11 @@ public void getOrderByIdTest() throws ApiException {
137136
*
138137
*
139138
*
140-
* @throws ApiException
139+
* @throws Exception
141140
* if the Api call fails
142141
*/
143142
@Test
144-
public void placeOrderTest() throws ApiException {
143+
public void placeOrderTest() throws Exception {
145144
Order body = new Order().id(10L)
146145
.petId(10L)
147146
.complete(false)

samples/custom-tests/java/v3/okhttp-gson/UserApiTest.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
package io.swagger.client.api;
1515

16-
import io.swagger.client.ApiException;
1716
import io.swagger.client.model.User;
1817
import org.junit.Assert;
1918
import org.junit.Test;
@@ -86,11 +85,11 @@ public static void tearDown() {
8685
*
8786
* This can only be done by the logged in user.
8887
*
89-
* @throws ApiException
88+
* @throws Exception
9089
* if the Api call fails
9190
*/
9291
@Test
93-
public void createUserTest() throws ApiException {
92+
public void createUserTest() throws Exception {
9493
User body = new User().id(10L).username("user1");
9594
api.createUser(body);
9695

@@ -102,11 +101,11 @@ public void createUserTest() throws ApiException {
102101
*
103102
*
104103
*
105-
* @throws ApiException
104+
* @throws Exception
106105
* if the Api call fails
107106
*/
108107
@Test
109-
public void createUsersWithListInputTest() throws ApiException {
108+
public void createUsersWithListInputTest() throws Exception {
110109
User user = new User().id(10L).username("user1");
111110
List<User> body = Arrays.asList(user);
112111
api.createUsersWithListInput(body);
@@ -119,11 +118,11 @@ public void createUsersWithListInputTest() throws ApiException {
119118
*
120119
* This can only be done by the logged in user.
121120
*
122-
* @throws ApiException
121+
* @throws Exception
123122
* if the Api call fails
124123
*/
125124
@Test
126-
public void deleteUserTest() throws ApiException {
125+
public void deleteUserTest() throws Exception {
127126
String username = "user1";
128127
api.deleteUser(username);
129128

@@ -135,11 +134,11 @@ public void deleteUserTest() throws ApiException {
135134
*
136135
*
137136
*
138-
* @throws ApiException
137+
* @throws Exception
139138
* if the Api call fails
140139
*/
141140
@Test
142-
public void getUserByNameTest() throws ApiException {
141+
public void getUserByNameTest() throws Exception {
143142
String username = "user1";
144143
User response = api.getUserByName(username);
145144

0 commit comments

Comments
 (0)