Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion acceptance-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>acceptance-tests</artifactId>
<groupId>gov.cms.qpp.conversion</groupId>
<version>2024.2.9-RELEASE</version>
<version>2024.2.10-RELEASE</version>
<name>conversion-tests</name>
<packaging>jar</packaging>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion commandline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>gov.cms.qpp.conversion</groupId>
<artifactId>qpp-conversion-tool-parent</artifactId>
<version>2024.2.9-RELEASE</version>
<version>2024.2.10-RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.nio.file.FileSystem;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand Down Expand Up @@ -137,15 +136,15 @@ public Class<?> getLoggerType() {

@Test
void testValidPath_valid() {
Path path = Paths.get(VALID_FILE);
Path path = Path.of(VALID_FILE);
boolean valid = CommandLineRunner.isValid(path);

Truth.assertThat(valid).isTrue();
}

@Test
void testValidPath_invalid() {
Path path = Paths.get(INVALID_FILE);
Path path = Path.of(INVALID_FILE);
boolean invalid = CommandLineRunner.isValid(path);

Truth.assertThat(invalid).isFalse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import org.junit.After;
import org.junit.Test;
Expand All @@ -27,15 +26,15 @@ public class ConversionFileWriterWrapperTest {

@After
public void deleteFiles() throws IOException {
Files.deleteIfExists(Paths.get("valid-QRDA-III-latest-qpp.json"));
Files.deleteIfExists(Paths.get("not-a-QRDA-III-file-error.json"));
Files.deleteIfExists(Paths.get("qrda_bad_denominator-qpp.json"));
Files.deleteIfExists(Paths.get("qrda_bad_denominator-error.json"));
Files.deleteIfExists(Path.of("valid-QRDA-III-latest-qpp.json"));
Files.deleteIfExists(Path.of("not-a-QRDA-III-file-error.json"));
Files.deleteIfExists(Path.of("qrda_bad_denominator-qpp.json"));
Files.deleteIfExists(Path.of("qrda_bad_denominator-error.json"));
}

@Test
public void testValidQpp() {
Path path = Paths.get("src/test/resources/valid-QRDA-III-latest.xml");
Path path = Path.of("src/test/resources/valid-QRDA-III-latest.xml");
ConversionFileWriterWrapper converterWrapper = new ConversionFileWriterWrapper(path);

Context context = new Context();
Expand All @@ -46,7 +45,7 @@ public void testValidQpp() {

@Test
public void testInvalidQpp() {
Path path = Paths.get("src/test/resources/not-a-QRDA-III-file.xml");
Path path = Path.of("src/test/resources/not-a-QRDA-III-file.xml");
ConversionFileWriterWrapper converterWrapper = new ConversionFileWriterWrapper(path);

converterWrapper.transform();
Expand All @@ -56,7 +55,7 @@ public void testInvalidQpp() {

@Test
public void testSkipValidations() {
Path path = Paths.get("src/test/resources/qrda_bad_denominator.xml");
Path path = Path.of("src/test/resources/qrda_bad_denominator.xml");
ConversionFileWriterWrapper converterWrapper = new ConversionFileWriterWrapper(path);

Context context = new Context();
Expand All @@ -69,12 +68,12 @@ public void testSkipValidations() {
@Test
public void testErrorHasSourceId() throws IOException {
//when
Path path = Paths.get("src/test/resources/not-a-QRDA-III-file.xml");
Path path = Path.of("src/test/resources/not-a-QRDA-III-file.xml");
ConversionFileWriterWrapper converterWrapper = new ConversionFileWriterWrapper(path);
converterWrapper.transform();

//then
String sourceId = JsonTestHelper.readJsonAtJsonPath(Paths.get("not-a-QRDA-III-file-error.json"),
String sourceId = JsonTestHelper.readJsonAtJsonPath(Path.of("not-a-QRDA-III-file-error.json"),
"$.errors[0].sourceIdentifier", String.class);

assertThat(sourceId)
Expand All @@ -83,12 +82,12 @@ public void testErrorHasSourceId() throws IOException {

@Test
public void testErrorHasDetail() throws IOException {
Path path = Paths.get("src/test/resources/not-a-QRDA-III-file.xml");
Path path = Path.of("src/test/resources/not-a-QRDA-III-file.xml");

//when
ConversionFileWriterWrapper converterWrapper = new ConversionFileWriterWrapper(path);
converterWrapper.transform();
Detail detail = JsonTestHelper.readJsonAtJsonPath(Paths.get("not-a-QRDA-III-file-error.json"),
Detail detail = JsonTestHelper.readJsonAtJsonPath(Path.of("not-a-QRDA-III-file-error.json"),
"$.errors[0].details[0]", Detail.class);

//then
Expand All @@ -103,17 +102,17 @@ public void testErrorHasMultipleDetails() throws IOException {
//setup
LocalizedProblem firstError = ProblemCode.NUMERATOR_DENOMINATOR_INVALID_VALUE.format("Numerator", "-1");
LocalizedProblem secondError = ProblemCode.NUMERATOR_DENOMINATOR_INVALID_VALUE.format("Denominator", "-1");
Path path = Paths.get("src/test/resources/qrda_bad_denominator.xml");
Path path = Path.of("src/test/resources/qrda_bad_denominator.xml");

//when
ConversionFileWriterWrapper converterWrapper = new ConversionFileWriterWrapper(path);
converterWrapper.transform();
Detail firstDetail = JsonTestHelper.readJsonAtJsonPath(Paths.get("qrda_bad_denominator-error.json"),
Detail firstDetail = JsonTestHelper.readJsonAtJsonPath(Path.of("qrda_bad_denominator-error.json"),
"$.errors[0].details[0]", Detail.class);
Detail secondDetail = JsonTestHelper.readJsonAtJsonPath(Paths.get("qrda_bad_denominator-error.json"),
Detail secondDetail = JsonTestHelper.readJsonAtJsonPath(Path.of("qrda_bad_denominator-error.json"),
"$.errors[0].details[1]", Detail.class);

JsonTestHelper.readJsonAtJsonPath(Paths.get("qrda_bad_denominator-error.json"), "$.errors[0].details");
JsonTestHelper.readJsonAtJsonPath(Path.of("qrda_bad_denominator-error.json"), "$.errors[0].details");

//then
assertThat(firstDetail.getMessage()).isEqualTo(firstError.getMessage());
Expand All @@ -123,14 +122,14 @@ public void testErrorHasMultipleDetails() throws IOException {
}

private void assertFileExists(final String fileName) {
Path possibleFile = Paths.get(fileName);
Path possibleFile = Path.of(fileName);
assertWithMessage("The file %s must exist.", fileName)
.that(Files.exists(possibleFile))
.isTrue();
}

private void assertFileDoesNotExists(final String fileName) {
Path possibleFile = Paths.get(fileName);
Path possibleFile = Path.of(fileName);
assertWithMessage("The file %s must NOT exist.", fileName)
.that(Files.exists(possibleFile))
.isFalse();
Expand Down
2 changes: 1 addition & 1 deletion commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>gov.cms.qpp.conversion</groupId>
<artifactId>qpp-conversion-tool-parent</artifactId>
<version>2024.2.9-RELEASE</version>
<version>2024.2.10-RELEASE</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Loading
Loading