diff --git a/src/main/java/eu/dissco/backend/service/MasJobRecordService.java b/src/main/java/eu/dissco/backend/service/MasJobRecordService.java index a9c8a0c..2e9f908 100644 --- a/src/main/java/eu/dissco/backend/service/MasJobRecordService.java +++ b/src/main/java/eu/dissco/backend/service/MasJobRecordService.java @@ -118,7 +118,7 @@ public String createJobRecordForDisscover(Annotation annotation, String orcid) { handle, JobState.RUNNING, "DISSCOVER", - annotation.getOaHasTarget().getId(), + annotation.getOaHasTarget().getId().replaceAll("https://(doi\\.org|hdl\\.handle\\.net)/", ""), getMjrTargetType(annotation), orcid, true, diff --git a/src/test/java/eu/dissco/backend/service/MasJobRecordServiceTest.java b/src/test/java/eu/dissco/backend/service/MasJobRecordServiceTest.java index ef8a0d3..35af2a6 100644 --- a/src/test/java/eu/dissco/backend/service/MasJobRecordServiceTest.java +++ b/src/test/java/eu/dissco/backend/service/MasJobRecordServiceTest.java @@ -1,5 +1,6 @@ package eu.dissco.backend.service; +import static eu.dissco.backend.TestUtils.HANDLE; import static eu.dissco.backend.TestUtils.ID; import static eu.dissco.backend.TestUtils.ID_ALT; import static eu.dissco.backend.TestUtils.MAPPER; @@ -157,7 +158,7 @@ void testCreateMasJobRecordForDissco() { JOB_ID, JobState.RUNNING, "DISSCOVER", - TARGET_ID, + TARGET_ID.replace(HANDLE,""), MjrTargetType.DIGITAL_SPECIMEN, ORCID, true, @@ -180,7 +181,7 @@ void testCreateMasJobRecordForDisscoMedia() { JOB_ID, JobState.RUNNING, "DISSCOVER", - TARGET_ID, + TARGET_ID.replace(HANDLE,""), MjrTargetType.MEDIA_OBJECT, ORCID, true,