Search in sources :

Example 1 with JsonPathToXpathHelper

use of gov.cms.qpp.acceptance.helper.JsonPathToXpathHelper in project qpp-conversion-tool by CMSgov.

the class CpcPlusRoundTripTest method setup.

@BeforeAll
static void setup() throws URISyntaxException {
    ApmEntityIds.setApmDataFile("test_apm_entity_ids.json");
    URL sample = CpcPlusRoundTripTest.class.getClassLoader().getResource("cpc_plus/success/CPCPlus_CMSPrgrm_LowerCase_SampleQRDA-III.xml");
    Path path = Paths.get(sample.toURI());
    new JsonPathToXpathHelper(path, wrapper, false);
    ctx = JsonPath.parse(wrapper.toString());
}
Also used : JsonPath(com.jayway.jsonpath.JsonPath) Path(java.nio.file.Path) JsonPathToXpathHelper(gov.cms.qpp.acceptance.helper.JsonPathToXpathHelper) URL(java.net.URL) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 2 with JsonPathToXpathHelper

use of gov.cms.qpp.acceptance.helper.JsonPathToXpathHelper in project qpp-conversion-tool by CMSgov.

the class JsonPathToXpathCoverageTest method testCoverage.

@ParameterizedTest
@MethodSource("paths")
void testCoverage(Path path) throws IOException {
    JsonWrapper metaWrapper = new JsonWrapper(false);
    helper = new JsonPathToXpathHelper(path, metaWrapper, false);
    JsonWrapper wrapper = new JsonWrapper(metaWrapper, true);
    JsonNode root = om.readTree(wrapper.toString());
    JsonPathAggregator agg = new JsonPathAggregator(root);
    agg.getJsonPaths().forEach((key, value) -> helper.executeAttributeTest(key, value));
}
Also used : JsonWrapper(gov.cms.qpp.conversion.encode.JsonWrapper) JsonPathToXpathHelper(gov.cms.qpp.acceptance.helper.JsonPathToXpathHelper) JsonNode(com.fasterxml.jackson.databind.JsonNode) JsonPathAggregator(gov.cms.qpp.acceptance.helper.JsonPathAggregator) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

JsonPathToXpathHelper (gov.cms.qpp.acceptance.helper.JsonPathToXpathHelper)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 JsonPath (com.jayway.jsonpath.JsonPath)1 JsonPathAggregator (gov.cms.qpp.acceptance.helper.JsonPathAggregator)1 JsonWrapper (gov.cms.qpp.conversion.encode.JsonWrapper)1 URL (java.net.URL)1 Path (java.nio.file.Path)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1