From 77883e35ba76c739156def670bcce3c0f9529058 Mon Sep 17 00:00:00 2001 From: pkiraly Date: Thu, 27 May 2021 18:45:41 +0200 Subject: [PATCH 1/3] #7906 delete extra space from the end of an API success message. --- src/main/java/edu/harvard/iq/dataverse/api/Admin.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/api/Admin.java b/src/main/java/edu/harvard/iq/dataverse/api/Admin.java index f0a9f8cf780..1df51137969 100644 --- a/src/main/java/edu/harvard/iq/dataverse/api/Admin.java +++ b/src/main/java/edu/harvard/iq/dataverse/api/Admin.java @@ -379,9 +379,8 @@ private Response deleteAuthenticatedUser(AuthenticatedUser au) { authSvc.removeAuthentictedUserItems(au); authSvc.deleteAuthenticatedUser(au.getId()); - return ok("AuthenticatedUser " + au.getIdentifier() + " deleted. "); - - } + return ok("AuthenticatedUser " + au.getIdentifier() + " deleted."); + } @POST @Path("authenticatedUsers/{identifier}/deactivate") From 9a6e5d9b8001e0292b581e8e51f05d0c9053450b Mon Sep 17 00:00:00 2001 From: pkiraly Date: Thu, 27 May 2021 19:44:56 +0200 Subject: [PATCH 2/3] #7906 add integration tests. --- src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java b/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java index fc2ecd2955e..e0d66aa62b3 100644 --- a/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java +++ b/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java @@ -71,10 +71,15 @@ public void testListAuthenticatedUsers() throws Exception { Response deleteNonSuperuser = UtilIT.deleteUser(nonSuperuserUsername); assertEquals(200, deleteNonSuperuser.getStatusCode()); + assertEquals( + "{\"status\":\"OK\",\"data\":{\"message\":\"AuthenticatedUser @" + nonSuperuserUsername + " deleted.\"}}", + deleteNonSuperuser.getBody().asString()); Response deleteSuperuser = UtilIT.deleteUser(superuserUsername); assertEquals(200, deleteSuperuser.getStatusCode()); - + assertEquals( + "{\"status\":\"OK\",\"data\":{\"message\":\"AuthenticatedUser @" + superuserUsername + " deleted.\"}}", + deleteSuperuser.getBody().asString()); } From f1e726eacd2c4114ee78b47ffa505d5de4754327 Mon Sep 17 00:00:00 2001 From: pkiraly Date: Thu, 27 May 2021 20:45:57 +0200 Subject: [PATCH 3/3] #7906 remove integration tests. --- src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java b/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java index e0d66aa62b3..c34ee2dd4bf 100644 --- a/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java +++ b/src/test/java/edu/harvard/iq/dataverse/api/AdminIT.java @@ -71,17 +71,10 @@ public void testListAuthenticatedUsers() throws Exception { Response deleteNonSuperuser = UtilIT.deleteUser(nonSuperuserUsername); assertEquals(200, deleteNonSuperuser.getStatusCode()); - assertEquals( - "{\"status\":\"OK\",\"data\":{\"message\":\"AuthenticatedUser @" + nonSuperuserUsername + " deleted.\"}}", - deleteNonSuperuser.getBody().asString()); Response deleteSuperuser = UtilIT.deleteUser(superuserUsername); assertEquals(200, deleteSuperuser.getStatusCode()); - assertEquals( - "{\"status\":\"OK\",\"data\":{\"message\":\"AuthenticatedUser @" + superuserUsername + " deleted.\"}}", - deleteSuperuser.getBody().asString()); } - @Test public void testFilterAuthenticatedUsersForbidden() throws Exception {