use of org.folio.rest.jaxrs.model.JobProfileInfo.DataType.MARC in project mod-source-record-manager by folio-org.
the class MetadataProviderJobExecutionAPITest method shouldReturnUsersInfoCollection.
@Test
public void shouldReturnUsersInfoCollection() {
int uniqueJobProfilesAmount = 5;
List<JobExecution> createdJobExecution = constructAndPostInitJobExecutionRqDto(uniqueJobProfilesAmount).getJobExecutions();
getBeanFromSpringContext(vertx, JobExecutionsCache.class).evictCache();
List<JobExecution> children = createdJobExecution.stream().filter(jobExec -> jobExec.getSubordinationType().equals(CHILD)).collect(Collectors.toList());
for (JobExecution jobExecution : children) {
jobExecution.setJobProfileInfo(new JobProfileInfo().withId(UUID.randomUUID().toString()).withName("Marc jobs profile"));
RestAssured.given().spec(spec).body(JsonObject.mapFrom(jobExecution).toString()).when().put(JOB_EXECUTION_PATH + jobExecution.getId()).then().statusCode(HttpStatus.SC_OK).body("id", is(jobExecution.getId()));
}
RestAssured.given().spec(spec).when().get(GET_UNIQUE_USERS_INFO).then().statusCode(HttpStatus.SC_OK).body("jobExecutionUsersInfo[0].userId", notNullValue()).body("jobExecutionUsersInfo[0].jobUserFirstName", is("DIKU")).body("jobExecutionUsersInfo[0].jobUserLastName", is("ADMINISTRATOR")).body("totalRecords", is(1));
}
use of org.folio.rest.jaxrs.model.JobProfileInfo.DataType.MARC in project mod-source-record-manager by folio-org.
the class MetadataProviderJobExecutionAPITest method shouldReturnLimitedRelatedProfilesCollectionOnGetWithLimit.
@Test
public void shouldReturnLimitedRelatedProfilesCollectionOnGetWithLimit() {
int uniqueJobProfilesAmount = 5;
int limitNumber = 3;
List<JobExecution> createdJobExecution = constructAndPostInitJobExecutionRqDto(uniqueJobProfilesAmount).getJobExecutions();
getBeanFromSpringContext(vertx, JobExecutionsCache.class).evictCache();
List<JobExecution> children = createdJobExecution.stream().filter(jobExec -> jobExec.getSubordinationType().equals(CHILD)).collect(Collectors.toList());
for (JobExecution jobExecution : children) {
jobExecution.setJobProfileInfo(new JobProfileInfo().withId(UUID.randomUUID().toString()).withName("Marc jobs profile"));
RestAssured.given().spec(spec).body(JsonObject.mapFrom(jobExecution).toString()).when().put(JOB_EXECUTION_PATH + jobExecution.getId()).then().statusCode(HttpStatus.SC_OK).body("id", is(jobExecution.getId()));
}
RestAssured.given().spec(spec).param("limit", limitNumber).when().get(GET_JOB_EXECUTION_JOB_PROFILES_PATH).then().statusCode(HttpStatus.SC_OK).body("jobProfilesInfo", hasSize(limitNumber)).body("totalRecords", is(uniqueJobProfilesAmount));
}
Aggregations