Skip to content

Commit cef2f3f

Browse files
authored
Merge pull request #502 from CMSgov/bug/QPPCT-554_malformed_xml_500
QPPCT-554: better handling for malformed xml
2 parents e11f589 + fb05064 commit cef2f3f

File tree

12 files changed

+27
-19
lines changed

12 files changed

+27
-19
lines changed

benchmark/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>gov.cms.qpp.conversion</groupId>
88
<artifactId>qpp-conversion-tool-parent</artifactId>
9-
<version>0.33-SNAPSHOT</version>
9+
<version>0.34-SNAPSHOT</version>
1010
<relativePath>../</relativePath>
1111
</parent>
1212

commandline/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>gov.cms.qpp.conversion</groupId>
88
<artifactId>qpp-conversion-tool-parent</artifactId>
9-
<version>0.33-SNAPSHOT</version>
9+
<version>0.34-SNAPSHOT</version>
1010
<relativePath>../</relativePath>
1111
</parent>
1212

commons/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>gov.cms.qpp.conversion</groupId>
88
<artifactId>qpp-conversion-tool-parent</artifactId>
9-
<version>0.33-SNAPSHOT</version>
9+
<version>0.34-SNAPSHOT</version>
1010
<relativePath>../</relativePath>
1111
</parent>
1212

converter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>gov.cms.qpp.conversion</groupId>
88
<artifactId>qpp-conversion-tool-parent</artifactId>
9-
<version>0.33-SNAPSHOT</version>
9+
<version>0.34-SNAPSHOT</version>
1010
<relativePath>../</relativePath>
1111
</parent>
1212

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qpp-conversion-frontend",
3-
"version": "0.32",
3+
"version": "0.34",
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",

generate-qrda/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>qpp-conversion-tool-parent</artifactId>
77
<groupId>gov.cms.qpp.conversion</groupId>
8-
<version>0.33-SNAPSHOT</version>
8+
<version>0.34-SNAPSHOT</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>gov.cms.qpp.conversion</groupId>
77
<artifactId>qpp-conversion-tool-parent</artifactId>
88
<packaging>pom</packaging>
9-
<version>0.33-SNAPSHOT</version>
9+
<version>0.34-SNAPSHOT</version>
1010
<name>QPP Conversion Tool</name>
1111

1212
<properties>

rest-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>gov.cms.qpp.conversion</groupId>
88
<artifactId>qpp-conversion-tool-parent</artifactId>
9-
<version>0.33-SNAPSHOT</version>
9+
<version>0.34-SNAPSHOT</version>
1010
<relativePath>../</relativePath>
1111
</parent>
1212

rest-api/src/main/java/gov/cms/qpp/conversion/api/helper/MetadataHelper.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@ private MetadataHelper() {
2727
* @return
2828
*/
2929
public static Metadata generateMetadata(Node node, Outcome outcome) {
30-
Objects.requireNonNull(node, "node");
3130
Objects.requireNonNull(outcome, "outcome");
3231

3332
Metadata metadata = new Metadata();
3433

35-
metadata.setApm(findApm(node));
36-
metadata.setTin(findTin(node));
37-
metadata.setNpi(findNpi(node));
38-
metadata.setCpc(isCpc(node));
39-
metadata.setCpcProcessed(false);
34+
if (node != null) {
35+
metadata.setApm(findApm(node));
36+
metadata.setTin(findTin(node));
37+
metadata.setNpi(findNpi(node));
38+
metadata.setCpc(isCpc(node));
39+
metadata.setCpcProcessed(false);
40+
}
41+
4042
outcome.setStatus(metadata);
4143

4244
return metadata;

rest-api/src/test/java/gov/cms/qpp/conversion/api/helper/MetadataHelperTest.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ class MetadataHelperTest {
1616
private static final String MOCK_STRING = "some random mock value";
1717

1818
@Test
19-
void testGenerateMetadataForNullNodeThrowsNullPointerException() {
20-
Assertions.assertThrows(NullPointerException.class, () ->
21-
MetadataHelper.generateMetadata(null, MetadataHelper.Outcome.SUCCESS));
19+
void testGenerateMetadataForNullNodeReturnsSkinnyMetadata() {
20+
MetadataHelper.Outcome outcome = MetadataHelper.Outcome.VALIDATION_ERROR;
21+
Metadata comparison = new Metadata();
22+
comparison.setOverallStatus(false);
23+
comparison.setConversionStatus(true);
24+
comparison.setValidationStatus(false);
25+
26+
Metadata metadata = MetadataHelper.generateMetadata(null, outcome);
27+
assertThat(metadata).isEqualTo(comparison);
2228
}
2329

2430
@Test

0 commit comments

Comments
 (0)