Skip to content

Commit

Permalink
MODBULKOPS-389 Changed to Set
Browse files Browse the repository at this point in the history
  • Loading branch information
obozhko-folio committed Jan 6, 2025
1 parent 39f7e6e commit 639d3be
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/main/resources/swagger.api/schemas/bulk_operation_dto.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,24 @@
"format": "int64",
"default": 0
},
"matchedNumOfWarnings": {
"description": "Number of matching warnings",
"type": "integer",
"format": "int64",
"default": 0
},
"committedNumOfErrors": {
"description": "Number of committing errors",
"type": "integer",
"format": "int64",
"default": 0
},
"committedNumOfWarnings": {
"description": "Number of committing warnings",
"type": "integer",
"format": "int64",
"default": 0
},
"executionChunkSize": {
"description": "Size of chunk",
"type": "integer",
Expand Down
8 changes: 6 additions & 2 deletions src/main/resources/swagger.api/schemas/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
"description": "Error message type",
"$ref": "error_type.json#/ErrorType"
},
"code": {
"type": "string",
Expand All @@ -18,6 +18,10 @@
"type": "object",
"description": "Error message parameters",
"$ref": "parameters.json"
},
"field": {
"type": "string",
"description": "Name of failed field"
}
},
"additionalProperties": false,
Expand Down
12 changes: 12 additions & 0 deletions src/main/resources/swagger.api/schemas/error_type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Type of error",
"ErrorType": {
"type": "string",
"enum": [
"ERROR",
"WARNING"
],
"default": "ERROR"
}
}
5 changes: 3 additions & 2 deletions src/test/java/org/folio/bulkops/service/ErrorServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.folio.bulkops.domain.bean.RelatedInstanceInfo;
import org.folio.bulkops.domain.bean.SrsRecord;
import org.folio.bulkops.domain.dto.Error;
import org.folio.bulkops.domain.dto.ErrorType;
import org.folio.bulkops.domain.dto.Errors;
import org.folio.bulkops.domain.dto.IdentifierType;
import org.folio.bulkops.domain.dto.OperationStatusType;
Expand Down Expand Up @@ -407,8 +408,8 @@ private void mockErrorsData(OperationStatusType statusType, UUID operationId) {
if (DATA_MODIFICATION == statusType || COMPLETED_WITH_ERRORS == statusType) {
when(bulkEditClient.getErrorsPreview(any(UUID.class), anyInt()))
.thenReturn(new Errors()
.errors(List.of(new Error().type("BULK_EDIT_ERROR").message("123,No match found"),
new Error().type("BULK_EDIT_ERROR").message("456,Invalid format"))));
.errors(List.of(new Error().type(ErrorType.ERROR).message("123,No match found"),
new Error().type(ErrorType.ERROR).message("456,Invalid format"))));
} else {
executionContentRepository.save(BulkOperationExecutionContent.builder()
.bulkOperationId(operationId)
Expand Down

0 comments on commit 639d3be

Please sign in to comment.