diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClarinUserMetadataRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClarinUserMetadataRestController.java index 4494349ccb82..b109ea3c2e69 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClarinUserMetadataRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ClarinUserMetadataRestController.java @@ -223,9 +223,10 @@ public List processSignedInUser(Context context, EPerson cur currentUser.getID() + " is null."); } - // Copy current user_metadata records into a list and append it by a new ones. + // Copy current user_metadata records into a list and append it by a new user metadata. List newClarinUserMetadataList = new ArrayList<>(clarinUserRegistration.getUserMetadata()); + // Create user metadata records from request for (ClarinUserMetadataRest clarinUserMetadataRest : clarinUserMetadataRestList) { ClarinUserMetadata clarinUserMetadata = this.clarinUserMetadataService.create(context); clarinUserMetadata.setMetadataKey(clarinUserMetadataRest.getMetadataKey()); @@ -263,7 +264,6 @@ private ClarinLicenseResourceUserAllowance createClrua(Context context, clrua.setCreatedOn(Calendar.getInstance().getTime()); // Generate token to download the bitstream. The token is sent by the response or by the e-mail. clrua.setToken(downloadToken); - if (Objects.nonNull(clarinUserRegistration)) { clrua.setUserRegistration(clarinUserRegistration); } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ClarinUserMetadataImportControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ClarinUserMetadataImportControllerIT.java index 7360c9edcb05..91187884f528 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ClarinUserMetadataImportControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ClarinUserMetadataImportControllerIT.java @@ -255,7 +255,7 @@ public void importTwoTimesUserMetadataWithEpersonTest() throws Exception { .andExpect(status().isOk()); List allUserMetadata = clarinUserMetadataService.findAll(context); - // UserMetadata should be created a not updated + // UserMetadata should be created and not updated assertEquals(2, allUserMetadata.size()); // get first created data and check it