Search in sources :

Example 66 with Detail

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

the class ReportingParametersActValidatorTest method testPerformanceStartAndEndWithSlashesAndTimezone.

@Test
void testPerformanceStartAndEndWithSlashesAndTimezone() {
    Node reportingParametersActNode = createReportingParametersAct("2017/01/01", "2017/12/01T01:45:23.123", PERFORMANCE_YEAR);
    reportingParametersActValidator.internalValidateSingleNode(reportingParametersActNode);
    Set<Detail> error = reportingParametersActValidator.getDetails();
    assertThat(error).isEmpty();
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 67 with Detail

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

the class ReportingParametersActValidatorTest method testMissingPerformanceStartFromReportingParametersAct.

@Test
void testMissingPerformanceStartFromReportingParametersAct() {
    Node reportingParametersActNode = createReportingParametersAct(null, PERFORMANCE_END, PERFORMANCE_YEAR);
    reportingParametersActValidator.internalValidateSingleNode(reportingParametersActNode);
    Set<Detail> error = reportingParametersActValidator.getDetails();
    assertThat(error).comparingElementsUsing(DetailsErrorEquals.INSTANCE).contains(ErrorCode.REPORTING_PARAMETERS_MUST_CONTAIN_SINGLE_PERFORMANCE_START);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 68 with Detail

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

the class ReportingParametersActValidatorTest method testInvalidPerformanceEndFormat.

@Test
void testInvalidPerformanceEndFormat() {
    Node reportingParametersActNode = createReportingParametersAct(PERFORMANCE_START, TIMESTAMPED_DATE, PERFORMANCE_YEAR);
    reportingParametersActValidator.internalValidateSingleNode(reportingParametersActNode);
    Set<Detail> error = reportingParametersActValidator.getDetails();
    assertThat(error).comparingElementsUsing(DetailsErrorEquals.INSTANCE).contains(ErrorCode.INVALID_PERFORMANCE_PERIOD_FORMAT.format(TIMESTAMPED_DATE));
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 69 with Detail

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

the class ReportingParametersActValidatorTest method testMissingPerformanceYearFromReportingParametersAct.

@Test
void testMissingPerformanceYearFromReportingParametersAct() {
    Node reportingParametersActNode = createReportingParametersAct(PERFORMANCE_START, PERFORMANCE_END, null);
    reportingParametersActValidator.internalValidateSingleNode(reportingParametersActNode);
    Set<Detail> error = reportingParametersActValidator.getDetails();
    assertThat(error).comparingElementsUsing(DetailsErrorEquals.INSTANCE).contains(ErrorCode.REPORTING_PARAMETERS_MISSING_PERFORMANCE_YEAR);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 70 with Detail

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

the class AggregateCountValidatorTest method testValueTypeSuccess.

@Test
void testValueTypeSuccess() {
    Node aggregateCountNode = new Node(TemplateId.ACI_AGGREGATE_COUNT);
    aggregateCountNode.putValue(AggregateCountDecoder.AGGREGATE_COUNT, "7");
    AggregateCountValidator validator = new AggregateCountValidator();
    validator.internalValidateSingleNode(aggregateCountNode);
    Set<Detail> errors = validator.getDetails();
    assertWithMessage("there are no errors").that(errors).isEmpty();
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Aggregations

Detail (gov.cms.qpp.conversion.model.error.Detail)123 Test (org.junit.jupiter.api.Test)108 Node (gov.cms.qpp.conversion.model.Node)105 LocalizedError (gov.cms.qpp.conversion.model.error.LocalizedError)16 Converter (gov.cms.qpp.conversion.Converter)9 AllErrors (gov.cms.qpp.conversion.model.error.AllErrors)9 TransformException (gov.cms.qpp.conversion.model.error.TransformException)9 PathSource (gov.cms.qpp.conversion.PathSource)8 ArrayList (java.util.ArrayList)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 Context (gov.cms.qpp.conversion.Context)4 Test (org.junit.Test)4 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)4 QrdaDecoderEngine (gov.cms.qpp.conversion.decode.QrdaDecoderEngine)3 FormattedErrorCode (gov.cms.qpp.conversion.model.error.FormattedErrorCode)3 Path (java.nio.file.Path)2 LinkedHashSet (java.util.LinkedHashSet)2 InputStreamSupplierSource (gov.cms.qpp.conversion.InputStreamSupplierSource)1 JsonWrapper (gov.cms.qpp.conversion.encode.JsonWrapper)1 TemplateId (gov.cms.qpp.conversion.model.TemplateId)1