Skip to content

Commit

Permalink
MODSOURCE-859: Fix Sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiBordak committed Feb 21, 2025
1 parent 9d3509e commit 4ac8c79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,11 @@ public Future<Void> unDeleteRecordById(String id, IdType idType, Map<String, Str
var tenantId = okapiHeaders.get(OKAPI_TENANT_HEADER);
return recordDao.getRecordByExternalId(id, idType, tenantId)
.map(recordOptional -> recordOptional.orElseThrow(() -> new NotFoundException(format(NOT_FOUND_MESSAGE, Record.class.getSimpleName(), id))))
.map(record -> {
update005field(record);
record.withState(Record.State.ACTUAL);
ParsedRecordDaoUtil.updateLeaderStatus(record.getParsedRecord(), CORRECTED_LEADER_RECORD_STATUS);
return record;
.map(foundRecord -> {
update005field(foundRecord);
foundRecord.withState(Record.State.ACTUAL);
ParsedRecordDaoUtil.updateLeaderStatus(foundRecord.getParsedRecord(), CORRECTED_LEADER_RECORD_STATUS);
return foundRecord;
})
.compose(record -> updateRecord(record, okapiHeaders)).map(r -> null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,7 @@ public void shouldUnDeleteMarcRecord(TestContext context) {
.withExternalIdsHolder(
new ExternalIdsHolder()
.withInstanceId(UUID.randomUUID().toString())
.withInstanceHrid(RandomStringUtils.randomAlphanumeric(9)))
.withInstanceHrid("12345abcd"))
.withMetadata(marcBibMock.getMetadata());

var okapiHeaders = Map.of(OKAPI_TENANT_HEADER, TENANT_ID);
Expand Down

0 comments on commit 4ac8c79

Please sign in to comment.