use of org.apache.cxf.jaxrs.json.basic.JsonMapObject in project cxf by apache.
the class SwaggerToOpenApiConversionUtilsTest method verifyUserCreateWithListOrArrayPathPost.
private void verifyUserCreateWithListOrArrayPathPost(JsonMapObject store, String opId, OpenApiConfiguration cfg) {
JsonMapObject userPost = store.getJsonMapProperty("post");
assertEquals(6, userPost.size());
testCommonVerbPropsExceptSec(userPost, opId);
assertNull(userPost.getProperty("parameters"));
if (cfg.isCreateRequestBodies()) {
verifyRequestBodyRef(userPost, "UserArray");
} else {
JsonMapObject contentIn = verifyRequestBodyContent(userPost);
assertEquals(1, contentIn.size());
verifyArrayContent(contentIn, "application/json", "User");
}
testDefaultResponse(userPost);
}
use of org.apache.cxf.jaxrs.json.basic.JsonMapObject in project cxf by apache.
the class SwaggerToOpenApiConversionUtilsTest method verifyPetIdPathDelete.
private void verifyPetIdPathDelete(JsonMapObject pet) {
JsonMapObject petDel = pet.getJsonMapProperty("delete");
assertEquals(7, petDel.size());
testCommonVerbProps(petDel, "deletePet");
List<Map<String, Object>> parameters = petDel.getListMapProperty("parameters");
assertEquals(2, parameters.size());
JsonMapObject apiKeyParam = new JsonMapObject(parameters.get(0));
assertEquals("api_key", apiKeyParam.getProperty("name"));
assertEquals("header", apiKeyParam.getProperty("in"));
assertNull(apiKeyParam.getProperty("type"));
assertNull(apiKeyParam.getProperty("format"));
assertFalse(apiKeyParam.getBooleanProperty("required"));
JsonMapObject schema = apiKeyParam.getJsonMapProperty("schema");
assertEquals(1, schema.size());
assertEquals("string", schema.getProperty("type"));
JsonMapObject pathIdParam = new JsonMapObject(parameters.get(1));
verifyPetIdParameter(pathIdParam);
assertNull(petDel.getJsonMapProperty("requestBody"));
JsonMapObject responses = petDel.getJsonMapProperty("responses");
assertEquals(2, responses.size());
assertNotNull(responses.getProperty("400"));
assertNotNull(responses.getProperty("404"));
}
use of org.apache.cxf.jaxrs.json.basic.JsonMapObject in project cxf by apache.
the class SwaggerToOpenApiConversionUtilsTest method verifyUserLogoutPathGet.
private void verifyUserLogoutPathGet(JsonMapObject user) {
JsonMapObject userGet = user.getJsonMapProperty("get");
assertEquals(5, userGet.size());
testCommonVerbPropsExceptSec(userGet, "logoutUser");
assertNull(userGet.getListMapProperty("parameters"));
assertNull(userGet.getProperty("requestBody"));
JsonMapObject responses = userGet.getJsonMapProperty("responses");
assertEquals(1, responses.size());
testDefaultResponse(userGet);
}
use of org.apache.cxf.jaxrs.json.basic.JsonMapObject in project cxf by apache.
the class SwaggerToOpenApiConversionUtilsTest method verifyUserLogoutPath.
private void verifyUserLogoutPath(JsonMapObject paths) {
// /user/logout
JsonMapObject user = paths.getJsonMapProperty("/user/logout");
assertEquals(1, user.size());
verifyUserLogoutPathGet(user);
}
use of org.apache.cxf.jaxrs.json.basic.JsonMapObject in project cxf by apache.
the class SwaggerToOpenApiConversionUtilsTest method verifyUserUsernamePath.
private void verifyUserUsernamePath(JsonMapObject paths, OpenApiConfiguration cfg) {
// /user/{username}
JsonMapObject user = paths.getJsonMapProperty("/user/{username}");
assertEquals(3, user.size());
verifyUserUsernamePathGet(user);
verifyUserUsernamePathPut(user, cfg);
verifyUserUsernamePathDelete(user);
}
Aggregations