use of gov.cms.qpp.test.annotations.AcceptanceTest in project qpp-conversion-tool by CMSgov.
the class ValidationApiAcceptance method testUnprocessedFiles.
@AcceptanceTest
void testUnprocessedFiles() {
Response response = given().multiPart("file", PATH.toFile()).when().post("/");
AllErrors blah = response.getBody().as(AllErrors.class);
blah.getErrors().stream().flatMap(error -> error.getDetails().stream()).forEach(this::verifyDetail);
}
use of gov.cms.qpp.test.annotations.AcceptanceTest in project qpp-conversion-tool by CMSgov.
the class CpcApiAcceptance method testMarkFileProcessedNotCPC.
@AcceptanceTest
void testMarkFileProcessedNotCPC() {
Metadata metadata = createDatedCpcMetadata("2018-01-02T05:00:00.000Z");
metadata.setCpc(null);
mapper.save(metadata);
String responseBody = markFileAsProcessed(metadata.getUuid(), 404);
assertThat(responseBody).isEqualTo("The file was not a CPC+ file.");
}
use of gov.cms.qpp.test.annotations.AcceptanceTest in project qpp-conversion-tool by CMSgov.
the class CpcApiAcceptance method testUnprocessedFilesDates.
@AcceptanceTest
void testUnprocessedFilesDates() {
Metadata afterJanuarySecondMetadata = createDatedCpcMetadata("2018-01-02T05:00:00.000Z");
Metadata beforeJanuarySecondMetadata = createDatedCpcMetadata(DbServiceImpl.START_OF_UNALLOWED_CONVERSION_TIME);
Metadata anotherAllowedMetadata = createDatedCpcMetadata("2018-02-26T14:36:43.723Z");
Metadata anotherUnallowedMetadata = createDatedCpcMetadata("2017-12-25T00:00:00.000Z");
mapper.batchSave(afterJanuarySecondMetadata, beforeJanuarySecondMetadata, anotherAllowedMetadata, anotherUnallowedMetadata);
List<Map> responseBody = getUnprocessedFiles();
responseBody.stream().forEach(map -> assertThat(Instant.parse((String) map.get("conversionDate"))).isGreaterThan(Instant.parse(DbServiceImpl.START_OF_UNALLOWED_CONVERSION_TIME)));
}
use of gov.cms.qpp.test.annotations.AcceptanceTest in project qpp-conversion-tool by CMSgov.
the class ValidationApiFailureAcceptance method testSuccess.
@AcceptanceTest
void testSuccess() {
Response response = performRequest(getQrda(null));
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.CREATED.value());
}
Aggregations