Skip to content

Commit

Permalink
update tests for java microprofile server
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed May 14, 2024
1 parent ec10264 commit b4db062
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import java.io.File;
import org.openapitools.server.model.ModelApiResponse;
import org.openapitools.server.model.Pet;
import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Assertions;

import org.eclipse.microprofile.rest.client.RestClientBuilder;

Expand All @@ -40,7 +40,7 @@ public class PetApiTest {
private PetApi client;
private String baseUrl = "http://localhost:9080";

@Before
@BeforeEach
public void setup() throws MalformedURLException {
client = RestClientBuilder.newBuilder()
.baseUrl(new URL(baseUrl))
Expand All @@ -62,7 +62,7 @@ public void addPetTest() {
// TODO: test validations
Pet pet = null;
//Uni<Pet> response = api.addPet(pet);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -81,7 +81,7 @@ public void deletePetTest() {
Long petId = null;
String apiKey = null;
//api.deletePet(petId, apiKey);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -99,7 +99,7 @@ public void findPetsByStatusTest() {
// TODO: test validations
List<String> status = null;
//Uni<List<Pet>> response = api.findPetsByStatus(status);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -117,7 +117,7 @@ public void findPetsByTagsTest() {
// TODO: test validations
List<String> tags = null;
//Uni<List<Pet>> response = api.findPetsByTags(tags);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -135,7 +135,7 @@ public void getPetByIdTest() {
// TODO: test validations
Long petId = null;
//Uni<Pet> response = api.getPetById(petId);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -153,7 +153,7 @@ public void updatePetTest() {
// TODO: test validations
Pet pet = null;
//Uni<Pet> response = api.updatePet(pet);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -173,7 +173,7 @@ public void updatePetWithFormTest() {
String name = null;
String status = null;
//api.updatePetWithForm(petId, name, status);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -193,7 +193,7 @@ public void uploadFileTest() {
String additionalMetadata = null;
org.apache.cxf.jaxrs.ext.multipart.Attachment _file = null;
//Uni<ModelApiResponse> response = api.uploadFile(petId, additionalMetadata, _file);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
package org.openapitools.server.api;

import org.openapitools.server.model.Order;
import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Assertions;

import org.eclipse.microprofile.rest.client.RestClientBuilder;

Expand All @@ -38,7 +38,7 @@ public class StoreApiTest {
private StoreApi client;
private String baseUrl = "http://localhost:9080";

@Before
@BeforeEach
public void setup() throws MalformedURLException {
client = RestClientBuilder.newBuilder()
.baseUrl(new URL(baseUrl))
Expand All @@ -60,7 +60,7 @@ public void deleteOrderTest() {
// TODO: test validations
String orderId = null;
//api.deleteOrder(orderId);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -77,7 +77,7 @@ public void deleteOrderTest() {
public void getInventoryTest() {
// TODO: test validations
//Uni<Map<String, Integer>> response = api.getInventory();
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -95,7 +95,7 @@ public void getOrderByIdTest() {
// TODO: test validations
Long orderId = null;
//Uni<Order> response = api.getOrderById(orderId);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -113,7 +113,7 @@ public void placeOrderTest() {
// TODO: test validations
Order order = null;
//Uni<Order> response = api.placeOrder(order);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

import java.util.Date;
import org.openapitools.server.model.User;
import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Assertions;

import org.eclipse.microprofile.rest.client.RestClientBuilder;

Expand All @@ -39,7 +39,7 @@ public class UserApiTest {
private UserApi client;
private String baseUrl = "http://localhost:9080";

@Before
@BeforeEach
public void setup() throws MalformedURLException {
client = RestClientBuilder.newBuilder()
.baseUrl(new URL(baseUrl))
Expand All @@ -61,7 +61,7 @@ public void createUserTest() {
// TODO: test validations
User user = null;
//api.createUser(user);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -79,7 +79,7 @@ public void createUsersWithArrayInputTest() {
// TODO: test validations
List<User> user = null;
//api.createUsersWithArrayInput(user);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -97,7 +97,7 @@ public void createUsersWithListInputTest() {
// TODO: test validations
List<User> user = null;
//api.createUsersWithListInput(user);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -115,7 +115,7 @@ public void deleteUserTest() {
// TODO: test validations
String username = null;
//api.deleteUser(username);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -133,7 +133,7 @@ public void getUserByNameTest() {
// TODO: test validations
String username = null;
//Uni<User> response = api.getUserByName(username);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -152,7 +152,7 @@ public void loginUserTest() {
String username = null;
String password = null;
//Uni<String> response = api.loginUser(username, password);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -169,7 +169,7 @@ public void loginUserTest() {
public void logoutUserTest() {
// TODO: test validations
//api.logoutUser();
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand All @@ -188,7 +188,7 @@ public void updateUserTest() {
String username = null;
User user = null;
//api.updateUser(username, user);
//assertNotNull(response);
//Assertions.assertNotNull(response);


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand All @@ -18,37 +18,37 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
* Model tests for Category
*/
public class CategoryTest {
class CategoryTest {
private final Category model = new Category();

/**
* Model tests for Category
*/
@Test
public void testCategory() {
void testCategory() {
// TODO: test Category
}

/**
* Test the property 'id'
*/
@Test
public void idTest() {
void idTest() {
// TODO: test id
}

/**
* Test the property 'name'
*/
@Test
public void nameTest() {
void nameTest() {
// TODO: test name
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
Expand All @@ -18,45 +18,45 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
* Model tests for ModelApiResponse
*/
public class ModelApiResponseTest {
class ModelApiResponseTest {
private final ModelApiResponse model = new ModelApiResponse();

/**
* Model tests for ModelApiResponse
*/
@Test
public void testModelApiResponse() {
void testModelApiResponse() {
// TODO: test ModelApiResponse
}

/**
* Test the property 'code'
*/
@Test
public void codeTest() {
void codeTest() {
// TODO: test code
}

/**
* Test the property 'type'
*/
@Test
public void typeTest() {
void typeTest() {
// TODO: test type
}

/**
* Test the property 'message'
*/
@Test
public void messageTest() {
void messageTest() {
// TODO: test message
}

Expand Down
Loading

0 comments on commit b4db062

Please sign in to comment.