Search in sources :

Example 1 with Converter

use of gov.cms.qpp.conversion.Converter in project qpp-conversion-tool by CMSgov.

the class QrdaQppAssociationTest method setup.

@BeforeAll
static void setup() {
    Path path = Paths.get("../qrda-files/valid-QRDA-III-latest.xml");
    Converter converter = new Converter(new PathSource(path));
    qpp = converter.transform();
}
Also used : Path(java.nio.file.Path) PathSource(gov.cms.qpp.conversion.PathSource) Converter(gov.cms.qpp.conversion.Converter) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 2 with Converter

use of gov.cms.qpp.conversion.Converter in project qpp-conversion-tool by CMSgov.

the class ReportingParametersActRoundTripTest method setUp.

@BeforeAll
public static void setUp() {
    Converter converter = new Converter(new PathSource(VALID_QRDA_III));
    JsonWrapper qpp = converter.transform();
    json = qpp.toString();
}
Also used : JsonWrapper(gov.cms.qpp.conversion.encode.JsonWrapper) PathSource(gov.cms.qpp.conversion.PathSource) Converter(gov.cms.qpp.conversion.Converter) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 3 with Converter

use of gov.cms.qpp.conversion.Converter in project qpp-conversion-tool by CMSgov.

the class SubmissionIntegrationTest method loadQpp.

private JsonWrapper loadQpp() {
    Path path = Paths.get("../qrda-files/valid-QRDA-III-latest.xml");
    Converter converter = new Converter(new PathSource(path));
    return converter.transform();
}
Also used : Path(java.nio.file.Path) PathSource(gov.cms.qpp.conversion.PathSource) Converter(gov.cms.qpp.conversion.Converter)

Example 4 with Converter

use of gov.cms.qpp.conversion.Converter in project qpp-conversion-tool by CMSgov.

the class CpcPlusAcceptanceTest method testCpcPlusFileSuccesses.

@ParameterizedTest
@MethodSource("successData")
void testCpcPlusFileSuccesses(Path entry) {
    AllErrors errors = null;
    Converter converter = new Converter(new PathSource(entry));
    try {
        converter.transform();
    } catch (TransformException failure) {
        errors = failure.getDetails();
    }
    assertThat(errors).isNull();
}
Also used : AllErrors(gov.cms.qpp.conversion.model.error.AllErrors) PathSource(gov.cms.qpp.conversion.PathSource) TransformException(gov.cms.qpp.conversion.model.error.TransformException) Converter(gov.cms.qpp.conversion.Converter) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 5 with Converter

use of gov.cms.qpp.conversion.Converter in project qpp-conversion-tool by CMSgov.

the class CpcPlusAcceptanceTest method testCpcPlusFileFailures.

@ParameterizedTest
@MethodSource("failureData")
void testCpcPlusFileFailures(Path entry) {
    String fileName = entry.getFileName().toString();
    assertWithMessage("No associated entry in fixture.json for the file %s", fileName).that(fixtureValues).containsKey(fileName);
    Converter converter = new Converter(new PathSource(entry));
    TransformException expected = Assertions.assertThrows(TransformException.class, converter::transform);
    // runnning conversions on individual files
    List<Detail> details = expected.getDetails().getErrors().get(0).getDetails();
    verifyOutcome(fileName, details);
}
Also used : PathSource(gov.cms.qpp.conversion.PathSource) TransformException(gov.cms.qpp.conversion.model.error.TransformException) Converter(gov.cms.qpp.conversion.Converter) Detail(gov.cms.qpp.conversion.model.error.Detail) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

Converter (gov.cms.qpp.conversion.Converter)34 PathSource (gov.cms.qpp.conversion.PathSource)28 Test (org.junit.jupiter.api.Test)18 TransformException (gov.cms.qpp.conversion.model.error.TransformException)16 AllErrors (gov.cms.qpp.conversion.model.error.AllErrors)15 JsonWrapper (gov.cms.qpp.conversion.encode.JsonWrapper)9 Detail (gov.cms.qpp.conversion.model.error.Detail)9 Path (java.nio.file.Path)9 ArrayList (java.util.ArrayList)6 BeforeAll (org.junit.jupiter.api.BeforeAll)4 Map (java.util.Map)3 Context (gov.cms.qpp.conversion.Context)2 ConversionReport (gov.cms.qpp.conversion.ConversionReport)2 InputStreamSupplierSource (gov.cms.qpp.conversion.InputStreamSupplierSource)2 LocalizedError (gov.cms.qpp.conversion.model.error.LocalizedError)2 InputStream (java.io.InputStream)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 MethodSource (org.junit.jupiter.params.provider.MethodSource)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ObjectWriter (com.fasterxml.jackson.databind.ObjectWriter)1