io.restassured.path.json.JsonPath.getJsonObject()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(158)

本文整理了Java中io.restassured.path.json.JsonPath.getJsonObject()方法的一些代码示例,展示了JsonPath.getJsonObject()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonPath.getJsonObject()方法的具体详情如下:
包路径:io.restassured.path.json.JsonPath
类名称:JsonPath
方法名:getJsonObject

JsonPath.getJsonObject介绍

暂无

代码示例

代码示例来源:origin: rest-assured/rest-assured

Object object = getJsonObject(path);
if (object == null) {
  return null;

代码示例来源:origin: rest-assured/rest-assured

Object object = getJsonObject(path);
if (object == null) {
  return null;

代码示例来源:origin: camunda/camunda-bpm-platform

List<Map<String, Object>> variables = from(content).getJsonObject("_embedded.variable");

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testGetFilterWithSingleSorting() {
 TaskQuery query = new TaskQueryImpl()
  .orderByTaskName().desc();
 Filter filter = new FilterEntity("Task").setName("test").setQuery(query);
 when(filterServiceMock.getFilter(EXAMPLE_FILTER_ID)).thenReturn(filter);
 Response response = given()
  .pathParam("id", EXAMPLE_FILTER_ID)
 .then().expect()
  .statusCode(Status.OK.getStatusCode())
 .when()
  .get(SINGLE_FILTER_URL);
 // validate sorting content
 String content = response.asString();
 List<Map<String, Object>> sortings = from(content).getJsonObject("query.sorting");
 assertThat(sortings).hasSize(1);
 assertSorting(sortings.get(0), SORT_BY_NAME_VALUE, SORT_ORDER_DESC_VALUE);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testGetFilterWithVariableTypeSorting() {
 TaskQuery query = new TaskQueryImpl()
  .orderByExecutionVariable("foo", ValueType.STRING).asc()
  .orderByProcessVariable("foo", ValueType.STRING).asc()
  .orderByTaskVariable("foo", ValueType.STRING).asc()
  .orderByCaseExecutionVariable("foo", ValueType.STRING).asc()
  .orderByCaseInstanceVariable("foo", ValueType.STRING).asc();
 Filter filter = new FilterEntity("Task").setName("test").setQuery(query);
 when(filterServiceMock.getFilter(EXAMPLE_FILTER_ID)).thenReturn(filter);
 Response response = given()
  .pathParam("id", EXAMPLE_FILTER_ID)
 .then().expect()
  .statusCode(Status.OK.getStatusCode())
 .when()
  .get(SINGLE_FILTER_URL);
 // validate sorting content
 String content = response.asString();
 List<Map<String, Object>> sortings = from(content).getJsonObject("query.sorting");
 assertThat(sortings).hasSize(5);
 assertSorting(sortings.get(0), SORT_BY_EXECUTION_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.STRING);
 assertSorting(sortings.get(1), SORT_BY_PROCESS_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.STRING);
 assertSorting(sortings.get(2), SORT_BY_TASK_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.STRING);
 assertSorting(sortings.get(3), SORT_BY_CASE_EXECUTION_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.STRING);
 assertSorting(sortings.get(4), SORT_BY_CASE_INSTANCE_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.STRING);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testGetFilterWithMultipleSorting() {
 TaskQuery query = new TaskQueryImpl()
  .orderByDueDate().asc()
  .orderByCaseExecutionId().desc();
 Filter filter = new FilterEntity("Task").setName("test").setQuery(query);
 when(filterServiceMock.getFilter(EXAMPLE_FILTER_ID)).thenReturn(filter);
 Response response = given()
  .pathParam("id", EXAMPLE_FILTER_ID)
 .then().expect()
  .statusCode(Status.OK.getStatusCode())
 .when()
  .get(SINGLE_FILTER_URL);
 // validate sorting content
 String content = response.asString();
 List<Map<String, Object>> sortings = from(content).getJsonObject("query.sorting");
 assertThat(sortings).hasSize(2);
 assertSorting(sortings.get(0), SORT_BY_DUE_DATE_VALUE, SORT_ORDER_ASC_VALUE);
 assertSorting(sortings.get(1), SORT_BY_CASE_EXECUTION_ID_VALUE, SORT_ORDER_DESC_VALUE);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testGetFilterWithVariableSortOrderSorting() {
 TaskQuery query = new TaskQueryImpl()
  .orderByExecutionVariable("foo", ValueType.STRING).asc()
  .orderByExecutionVariable("foo", ValueType.STRING).desc();
 Filter filter = new FilterEntity("Task").setName("test").setQuery(query);
 when(filterServiceMock.getFilter(EXAMPLE_FILTER_ID)).thenReturn(filter);
 Response response = given()
  .pathParam("id", EXAMPLE_FILTER_ID)
 .then().expect()
  .statusCode(Status.OK.getStatusCode())
 .when()
  .get(SINGLE_FILTER_URL);
 // validate sorting content
 String content = response.asString();
 List<Map<String, Object>> sortings = from(content).getJsonObject("query.sorting");
 assertThat(sortings).hasSize(2);
 assertSorting(sortings.get(0), SORT_BY_EXECUTION_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.STRING);
 assertSorting(sortings.get(1), SORT_BY_EXECUTION_VARIABLE, SORT_ORDER_DESC_VALUE, "foo", ValueType.STRING);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Test
public void testGetFilterWithVariableValueTypeSorting() {
 TaskQuery query = new TaskQueryImpl()
  .orderByExecutionVariable("foo", ValueType.STRING).asc()
  .orderByExecutionVariable("foo", ValueType.INTEGER).asc()
  .orderByExecutionVariable("foo", ValueType.SHORT).asc()
  .orderByExecutionVariable("foo", ValueType.DATE).asc()
  .orderByExecutionVariable("foo", ValueType.BOOLEAN).asc()
  .orderByExecutionVariable("foo", ValueType.LONG).asc()
  .orderByExecutionVariable("foo", ValueType.DOUBLE).asc();
 Filter filter = new FilterEntity("Task").setName("test").setQuery(query);
 when(filterServiceMock.getFilter(EXAMPLE_FILTER_ID)).thenReturn(filter);
 Response response = given()
  .pathParam("id", EXAMPLE_FILTER_ID)
 .then().expect()
  .statusCode(Status.OK.getStatusCode())
 .when()
  .get(SINGLE_FILTER_URL);
 // validate sorting content
 String content = response.asString();
 List<Map<String, Object>> sortings = from(content).getJsonObject("query.sorting");
 assertThat(sortings).hasSize(7);
 assertSorting(sortings.get(0), SORT_BY_EXECUTION_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.STRING);
 assertSorting(sortings.get(1), SORT_BY_EXECUTION_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.INTEGER);
 assertSorting(sortings.get(2), SORT_BY_EXECUTION_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.SHORT);
 assertSorting(sortings.get(3), SORT_BY_EXECUTION_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.DATE);
 assertSorting(sortings.get(4), SORT_BY_EXECUTION_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.BOOLEAN);
 assertSorting(sortings.get(5), SORT_BY_EXECUTION_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.LONG);
 assertSorting(sortings.get(6), SORT_BY_EXECUTION_VARIABLE, SORT_ORDER_ASC_VALUE, "foo", ValueType.DOUBLE);
}

代码示例来源:origin: camunda/camunda-bpm-platform

String returnedName = from(content).getString("[0].name");
String returnedOwner = from(content).getString("[0].owner");
Map<String, Object> returnedQuery = from(content).getJsonObject("[0].query");
Map<String, Object> returnedProperties = from(content).getJsonObject("[0].properties");
returnedName = from(content).getString("[1].name");
returnedOwner = from(content).getString("[1].owner");
returnedQuery = from(content).getJsonObject("[1].query");
returnedProperties = from(content).getJsonObject("[1].properties");

代码示例来源:origin: camunda/camunda-bpm-platform

List<Map<String, Object>> sortings = from(content).getJsonObject("query.sorting");
assertThat(sortings).hasSize(14);
assertSorting(sortings.get(0), SORT_BY_PROCESS_INSTANCE_ID_VALUE, SORT_ORDER_ASC_VALUE);

代码示例来源:origin: io.rest-assured/json-path

Object object = getJsonObject(path);
if (object == null) {
  return null;

相关文章