Search in sources :

Example 11 with LocalizedError

use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.

the class CpcMeasureDataValidatorTest method validateFailureSupplementalDataMissingCountTest.

@Test
void validateFailureSupplementalDataMissingCountTest() throws Exception {
    String failurePayerFile = TestHelper.getFixture("failureSupplementalDataCountFile.xml");
    Node placeholder = new QrdaDecoderEngine(new Context()).decode(XmlUtils.stringToDom(failurePayerFile));
    CpcMeasureDataValidator validator = new CpcMeasureDataValidator();
    Node underTest = placeholder.findFirstNode(TemplateId.MEASURE_DATA_CMS_V2);
    validator.internalValidateSingleNode(underTest);
    LocalizedError expectedError = ErrorCode.CPC_PLUS_SUPPLEMENTAL_DATA_MISSING_COUNT.format(SupplementalData.MALE.getCode(), SubPopulationLabel.IPOP.name(), MEASURE_ID);
    Set<Detail> errors = validator.getDetails();
    assertThat(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).contains(expectedError);
}
Also used : Context(gov.cms.qpp.conversion.Context) Node(gov.cms.qpp.conversion.model.Node) LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) QrdaDecoderEngine(gov.cms.qpp.conversion.decode.QrdaDecoderEngine) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 12 with LocalizedError

use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.

the class ErrorCodeTest method testFormattedEqualsIdentity.

@Test
void testFormattedEqualsIdentity() {
    LocalizedError formatted = formatted("mock");
    new EqualsTester().addEqualityGroup(formatted).testEquals();
}
Also used : EqualsTester(com.google.common.testing.EqualsTester) LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 13 with LocalizedError

use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.

the class CpcQualityMeasureSectionValidatorTest method tooFewBmeasures.

@Test
void tooFewBmeasures() {
    Node node = setupMeasures(groupAmeasures, new String[] { groupBmeasures[0] });
    LocalizedError message = CpcGroupMinimum.B.makeError(groupBmeasures);
    validator.internalValidateSingleNode(node);
    assertThat(validator.getDetails()).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(message);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) Test(org.junit.jupiter.api.Test)

Example 14 with LocalizedError

use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.

the class CpcQualityMeasureSectionValidatorTest method missingGroupBmeasures.

@Test
void missingGroupBmeasures() {
    Node node = setupMeasures(groupAmeasures);
    LocalizedError message = CpcGroupMinimum.B.makeError(groupBmeasures);
    validator.internalValidateSingleNode(node);
    assertThat(validator.getDetails()).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(message);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) Test(org.junit.jupiter.api.Test)

Example 15 with LocalizedError

use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.

the class CpcQualityMeasureSectionValidatorTest method tooFewOverallmeasures.

@Test
void tooFewOverallmeasures() {
    Node node = setupMeasures(groupAmeasures, groupBmeasures);
    LocalizedError message = CpcGroupMinimum.makeOverallError(overallMeasures);
    validator.internalValidateSingleNode(node);
    assertThat(validator.getDetails()).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(message);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) Test(org.junit.jupiter.api.Test)

Aggregations

LocalizedError (gov.cms.qpp.conversion.model.error.LocalizedError)28 Test (org.junit.jupiter.api.Test)21 Node (gov.cms.qpp.conversion.model.Node)20 Detail (gov.cms.qpp.conversion.model.error.Detail)17 AllErrors (gov.cms.qpp.conversion.model.error.AllErrors)3 Converter (gov.cms.qpp.conversion.Converter)2 PathSource (gov.cms.qpp.conversion.PathSource)2 TransformException (gov.cms.qpp.conversion.model.error.TransformException)2 MeasureConfig (gov.cms.qpp.conversion.model.validation.MeasureConfig)2 ArrayList (java.util.ArrayList)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 EqualsTester (com.google.common.testing.EqualsTester)1 Context (gov.cms.qpp.conversion.Context)1 MeasureDataDecoder (gov.cms.qpp.conversion.decode.MeasureDataDecoder)1 MEASURE_POPULATION (gov.cms.qpp.conversion.decode.MeasureDataDecoder.MEASURE_POPULATION)1 PERFORMANCE_RATE_ID (gov.cms.qpp.conversion.decode.PerformanceRateProportionMeasureDecoder.PERFORMANCE_RATE_ID)1 QrdaDecoderEngine (gov.cms.qpp.conversion.decode.QrdaDecoderEngine)1 StratifierDecoder (gov.cms.qpp.conversion.decode.StratifierDecoder)1 Program (gov.cms.qpp.conversion.model.Program)1 TemplateId (gov.cms.qpp.conversion.model.TemplateId)1