本文整理汇总了Java中com.jayway.restassured.path.json.JsonPath.getMap方法的典型用法代码示例。如果您正苦于以下问题:Java JsonPath.getMap方法的具体用法?Java JsonPath.getMap怎么用?Java JsonPath.getMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jayway.restassured.path.json.JsonPath
的用法示例。
在下文中一共展示了JsonPath.getMap方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testOptionalBaseMetrics
import com.jayway.restassured.path.json.JsonPath; //导入方法依赖的package包/类
@Test
@RunAsClient
@InSequence(31)
public void testOptionalBaseMetrics() {
Header wantJson = new Header("Accept", APPLICATION_JSON);
JsonPath jsonPath = given().header(wantJson).options("/metrics/base").jsonPath();
Map<String, Object> elements = jsonPath.getMap(".");
Map<String, MiniMeta> names = getExpectedMetadataFromXmlFile(MetricRegistry.Type.BASE);
for (String item : names.keySet()) {
if (elements.containsKey(item) && names.get(item).optional) {
String prefix = names.get(item).name;
String type = "\""+prefix+"\""+".type";
String unit= "\""+prefix+"\""+".unit";
given().header(wantJson).options("/metrics/base/"+prefix).then().statusCode(200)
.body(type, equalTo(names.get(item).type))
.body(unit, equalTo(names.get(item).unit));
}
}
}
示例2: verifyDeploymentWithDefinitionsValues
import com.jayway.restassured.path.json.JsonPath; //导入方法依赖的package包/类
private void verifyDeploymentWithDefinitionsValues(Deployment mockDeployment, String responseContent) {
JsonPath path = from(responseContent);
verifyStandardDeploymentValues(mockDeployment, path);
Map<String, HashMap<String, Object>> deployedProcessDefinitions = path.getMap(PROPERTY_DEPLOYED_PROCESS_DEFINITIONS);
Map<String, HashMap<String, Object>> deployedCaseDefinitions = path.getMap(PROPERTY_DEPLOYED_CASE_DEFINITIONS);
Map<String, HashMap<String, Object>> deployedDecisionDefinitions = path.getMap(PROPERTY_DEPLOYED_DECISION_DEFINITIONS);
Map<String, HashMap<String, Object>> deployedDecisionRequirementsDefinitions = path.getMap(PROPERTY_DEPLOYED_DECISION_REQUIREMENTS_DEFINITIONS);
assertEquals(1, deployedProcessDefinitions.size());
assertNotNull(deployedProcessDefinitions.get(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID));
assertEquals(1, deployedCaseDefinitions.size());
assertNotNull(deployedCaseDefinitions.get(EXAMPLE_CASE_DEFINITION_ID));
assertEquals(1, deployedDecisionDefinitions.size());
assertNotNull(deployedDecisionDefinitions.get(EXAMPLE_DECISION_DEFINITION_ID));
assertEquals(1, deployedDecisionRequirementsDefinitions.size());
assertNotNull(deployedDecisionRequirementsDefinitions.get(EXAMPLE_DECISION_REQUIREMENTS_DEFINITION_ID));
}
示例3: verifyDrdDeploymentValues
import com.jayway.restassured.path.json.JsonPath; //导入方法依赖的package包/类
private void verifyDrdDeploymentValues(Deployment mockDeployment, String responseContent) {
JsonPath path = from(responseContent);
verifyStandardDeploymentValues(mockDeployment, path);
Map<String, HashMap<String, Object>> deployedDecisionDefinitions =
path.getMap(PROPERTY_DEPLOYED_DECISION_DEFINITIONS);
Map<String, HashMap<String, Object>> deployedDecisionRequirementsDefinitions =
path.getMap(PROPERTY_DEPLOYED_DECISION_REQUIREMENTS_DEFINITIONS);
assertEquals(1, deployedDecisionDefinitions.size());
HashMap decisionDefinitionDto = deployedDecisionDefinitions.get(EXAMPLE_DECISION_DEFINITION_ID);
assertNotNull(decisionDefinitionDto);
verifyDmnDeployment(decisionDefinitionDto);
assertEquals(1, deployedDecisionRequirementsDefinitions.size());
HashMap decisionRequirementsDefinitionDto = deployedDecisionRequirementsDefinitions.get(EXAMPLE_DECISION_REQUIREMENTS_DEFINITION_ID);
assertNotNull(decisionRequirementsDefinitionDto);
verifyDrdDeployment(decisionRequirementsDefinitionDto);
assertNull(path.get(PROPERTY_DEPLOYED_PROCESS_DEFINITIONS));
assertNull(path.get(PROPERTY_DEPLOYED_CASE_DEFINITIONS));
}
示例4: testBaseMetadataTypeAndUnit
import com.jayway.restassured.path.json.JsonPath; //导入方法依赖的package包/类
@Test
@RunAsClient
@InSequence(12)
public void testBaseMetadataTypeAndUnit() {
Header wantJson = new Header("Accept", APPLICATION_JSON);
JsonPath jsonPath = given().header(wantJson).options("/metrics/base").jsonPath();
Map<String, Map<String, Object>> elements = jsonPath.getMap(".");
Map<String, MiniMeta> expectedMetadata = getExpectedMetadataFromXmlFile(MetricRegistry.Type.BASE);
checkMetadataPresent(elements, expectedMetadata);
}
示例5: testApplicationMetadataTypeAndUnit
import com.jayway.restassured.path.json.JsonPath; //导入方法依赖的package包/类
@Test
@RunAsClient
@InSequence(20)
public void testApplicationMetadataTypeAndUnit() {
Header wantJson = new Header("Accept", APPLICATION_JSON);
JsonPath jsonPath = given().header(wantJson).options("/metrics/application").jsonPath();
Map<String, Map<String, Object>> elements = jsonPath.getMap(".");
Map<String, MiniMeta> expectedMetadata = getExpectedMetadataFromXmlFile(MetricRegistry.Type.APPLICATION);
checkMetadataPresent(elements, expectedMetadata);
}
示例6: verifyBpmnDeploymentValues
import com.jayway.restassured.path.json.JsonPath; //导入方法依赖的package包/类
private void verifyBpmnDeploymentValues(Deployment mockDeployment, String responseContent) {
JsonPath path = from(responseContent);
verifyStandardDeploymentValues(mockDeployment, path);
Map<String, HashMap<String, Object>> deployedProcessDefinitionDtos = path.getMap(PROPERTY_DEPLOYED_PROCESS_DEFINITIONS);
assertEquals(1, deployedProcessDefinitionDtos.size());
HashMap processDefinitionDto = deployedProcessDefinitionDtos.get(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID);
assertNotNull(processDefinitionDto);
verifyBpmnDeployment(processDefinitionDto);
assertNull(path.get(PROPERTY_DEPLOYED_CASE_DEFINITIONS));
assertNull(path.get(PROPERTY_DEPLOYED_DECISION_DEFINITIONS));
assertNull(path.get(PROPERTY_DEPLOYED_DECISION_REQUIREMENTS_DEFINITIONS));
}
示例7: verifyCmmnDeploymentValues
import com.jayway.restassured.path.json.JsonPath; //导入方法依赖的package包/类
private void verifyCmmnDeploymentValues(Deployment mockDeployment, String responseContent) {
JsonPath path = from(responseContent);
verifyStandardDeploymentValues(mockDeployment, path);
Map<String, HashMap<String, Object>> deployedCaseDefinitions = path.getMap(PROPERTY_DEPLOYED_CASE_DEFINITIONS);
assertEquals(1, deployedCaseDefinitions.size());
HashMap caseDefinitionDto = deployedCaseDefinitions.get(EXAMPLE_CASE_DEFINITION_ID);
assertNotNull(caseDefinitionDto);
verifyCmnDeployment(caseDefinitionDto);
assertNull(path.get(PROPERTY_DEPLOYED_PROCESS_DEFINITIONS));
assertNull(path.get(PROPERTY_DEPLOYED_DECISION_DEFINITIONS));
assertNull(path.get(PROPERTY_DEPLOYED_DECISION_REQUIREMENTS_DEFINITIONS));
}
示例8: verifyDmnDeploymentValues
import com.jayway.restassured.path.json.JsonPath; //导入方法依赖的package包/类
private void verifyDmnDeploymentValues(Deployment mockDeployment, String responseContent) {
JsonPath path = from(responseContent);
verifyStandardDeploymentValues(mockDeployment, path);
Map<String, HashMap<String, Object>> deployedDecisionDefinitions = path.getMap(PROPERTY_DEPLOYED_DECISION_DEFINITIONS);
assertEquals(1, deployedDecisionDefinitions.size());
HashMap decisionDefinitionDto = deployedDecisionDefinitions.get(EXAMPLE_DECISION_DEFINITION_ID);
assertNotNull(decisionDefinitionDto);
verifyDmnDeployment(decisionDefinitionDto);
assertNull(path.get(PROPERTY_DEPLOYED_DECISION_REQUIREMENTS_DEFINITIONS));
assertNull(path.get(PROPERTY_DEPLOYED_PROCESS_DEFINITIONS));
assertNull(path.get(PROPERTY_DEPLOYED_CASE_DEFINITIONS));
}