use of org.folio.rest.jaxrs.model.File in project mod-source-record-manager by folio-org.
the class ChangeManagerAPITest method shouldReturnErrorOnPostJobExecutionWhenFailedPostSnapshotToStorage.
@Test
public void shouldReturnErrorOnPostJobExecutionWhenFailedPostSnapshotToStorage() throws IOException {
WireMock.stubFor(post(SNAPSHOT_SERVICE_URL).willReturn(WireMock.serverError()));
InitJobExecutionsRqDto requestDto = new InitJobExecutionsRqDto();
String jsonFiles = TestUtil.readFileFromPath(FILES_PATH);
List<File> filesList = new ObjectMapper().readValue(jsonFiles, new TypeReference<>() {
});
requestDto.getFiles().addAll(filesList.stream().limit(1).collect(Collectors.toList()));
requestDto.setUserId(okapiUserIdHeader);
requestDto.setSourceType(InitJobExecutionsRqDto.SourceType.FILES);
RestAssured.given().spec(spec).body(JsonObject.mapFrom(requestDto).toString()).when().post(JOB_EXECUTION_PATH).then().statusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
}
Aggregations