Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JavokhirAbdullayev committed Oct 15, 2024
1 parent 34d01dc commit 39b228d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class JobExecutionFilter {
private String userId;
private Date completedAfter;
private Date completedBefore;
private String excludeJobProfileNames;
private String excludeJobProfileName;

public JobExecutionFilter withStatusAny(List<JobExecution.Status> statusAny) {
this.statusAny = statusAny;
Expand Down Expand Up @@ -72,8 +72,8 @@ public JobExecutionFilter withFileNamePattern(String fileNamePattern) {
return this;
}

public JobExecutionFilter withExcludeJobProfileName(String excludeJobProfileNames) {
this.excludeJobProfileNames = excludeJobProfileNames;
public JobExecutionFilter withExcludeJobProfileName(String excludeJobProfileName) {
this.excludeJobProfileName = excludeJobProfileName;
return this;
}

Expand Down Expand Up @@ -140,8 +140,8 @@ public String buildCriteria() {
addCondition(conditionBuilder, buildCaseInsensitiveLikeCondition(FILE_NAME_FIELD, fileNamePattern, false));
}
}
if (isNotEmpty(excludeJobProfileNames)) {
addCondition(conditionBuilder, buildCaseInsensitiveLikeCondition(JOB_PROFILE_NAME_FIELD, excludeJobProfileNames, true));
if (isNotEmpty(excludeJobProfileName)) {
addCondition(conditionBuilder, buildCaseInsensitiveLikeCondition(JOB_PROFILE_NAME_FIELD, excludeJobProfileName, true));
}
if (isNotEmpty(fileNameNotAny)) {
addCondition(conditionBuilder, buildNotInCondition(FILE_NAME_FIELD, fileNameNotAny));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public MetadataProviderImpl(Vertx vertx, String tenantId) { //NOSONAR
}

@Override
public void getMetadataProviderJobExecutions(String excludeJobProfileNames, List<String> statusAny, List<String> profileIdNotAny,
public void getMetadataProviderJobExecutions(String excludeJobProfileName, List<String> statusAny, List<String> profileIdNotAny,
String statusNot, List<String> uiStatusAny, String hrId, String fileName, List<String> fileNameNotAny,
List<String> profileIdAny, List<String> subordinationTypeNotAny, String userId, Date completedAfter,
Date completedBefore, List<String> sortBy, String totalRecords, int offset, int limit, Map<String, String> okapiHeaders,
Expand All @@ -72,7 +72,7 @@ public void getMetadataProviderJobExecutions(String excludeJobProfileNames, List
LOGGER.debug("getMetadataProviderJobExecutions:: sortBy {}", sortBy);
List<SortField> sortFields = mapSortQueryToSortFields(sortBy);
JobExecutionFilter filter = buildJobExecutionFilter(statusAny, profileIdNotAny, statusNot, uiStatusAny, hrId, fileName, fileNameNotAny, profileIdAny,
subordinationTypeNotAny, userId, completedAfter, completedBefore, excludeJobProfileNames);
subordinationTypeNotAny, userId, completedAfter, completedBefore, excludeJobProfileName);
jobExecutionService.getJobExecutionsWithoutParentMultiple(filter, sortFields, offset, limit, tenantId)
.map(GetMetadataProviderJobExecutionsResponse::respond200WithApplicationJson)
.map(Response.class::cast)
Expand Down Expand Up @@ -224,7 +224,7 @@ private JobExecutionFilter buildJobExecutionFilter(List<String> statusAny, List<
List<String> uiStatusAny, String hrIdPattern, String fileNamePattern,
List<String> fileNameNotAny, List<String> profileIdAny, List<String> subordinationTypeNotAny,
String userId, Date completedAfter, Date completedBefore,
String excludeJobProfileNames) {
String excludeJobProfileName) {
List<JobExecution.Status> statuses = statusAny.stream()
.map(JobExecution.Status::fromValue)
.toList();
Expand All @@ -240,7 +240,7 @@ private JobExecutionFilter buildJobExecutionFilter(List<String> statusAny, List<
return new JobExecutionFilter()
.withStatusAny(statuses)
.withProfileIdNotAny(profileIdNotAny)
.withExcludeJobProfileName(excludeJobProfileNames)
.withExcludeJobProfileName(excludeJobProfileName)
.withStatusNot(statusNot == null ? null : JobExecution.Status.fromValue(statusNot))
.withUiStatusAny(uiStatuses)
.withHrIdPattern(hrIdPattern)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ public void shouldReturnFilteredCollectionByExcludeJobProfileNameOnGet() {
RestAssured.given()
.spec(spec)
.when()
.queryParam("excludeJobProfileNames", "air")
.queryParam("excludeJobProfileName", "air")
.get(GET_JOB_EXECUTIONS_PATH)
.then()
.statusCode(HttpStatus.SC_OK)
Expand All @@ -582,7 +582,7 @@ public void shouldReturnFilteredCollectionByExcludeJobProfileNameWithWildcardOnG
RestAssured.given()
.spec(spec)
.when()
.queryParam("excludeJobProfileNames", "importBib*")
.queryParam("excludeJobProfileName", "importBib*")
.get(GET_JOB_EXECUTIONS_PATH)
.then()
.statusCode(HttpStatus.SC_OK)
Expand Down
2 changes: 1 addition & 1 deletion ramls/metadata-provider.raml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ resourceTypes:
pageable
]
queryParameters:
excludeJobProfileNames:
excludeJobProfileName:
description: Filter by Job profiles name
type: string
example: Bulk operations data import job profile - *
Expand Down

0 comments on commit 39b228d

Please sign in to comment.