From 659d14ec9c842803fb640e4351f6bdb1b93d6f90 Mon Sep 17 00:00:00 2001 From: milanmajchrak <90026355+milanmajchrak@users.noreply.github.com> Date: Thu, 31 Oct 2024 10:42:21 +0100 Subject: [PATCH] Internal/fix failing Clarin integration test (#796) * Initial commit * Ignore the test class from where the tests has started failing. * Ignored half of tests in the ClarinShibbolethLoginFilterIT file * Ignored all tests * unignore some tests * 3 tests ignored 3 allowed * Maybe the problematic test is hidden between 3 unignored tests * two candidates * The last candidate * Ignore just wrong test and all test should pass * Clean up object created in the test. * Removed unused import. * Check the user which is going to be deleted is not null. --- .../app/rest/security/ClarinShibbolethLoginFilterIT.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/security/ClarinShibbolethLoginFilterIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/security/ClarinShibbolethLoginFilterIT.java index 343f0c5fe035..6cf8c6058d7a 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/security/ClarinShibbolethLoginFilterIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/security/ClarinShibbolethLoginFilterIT.java @@ -276,6 +276,9 @@ public void testShouldReturnDuplicateUserErrorLoginWithoutNetId() throws Excepti .andExpect(redirectedUrl("http://localhost:4000/login/duplicate-user?email=" + email)) .andReturn().getResponse().getHeader("Authorization"); + // Check if was created a user with such email and netid. + EPerson ePerson = checkUserWasCreated(netId, IDP_TEST_EPERSON, email, null); + deleteShibbolethUser(ePerson); } // This test is copied from the `ShibbolethLoginFilterIT` and modified following the Clarin updates. @@ -567,6 +570,7 @@ public void testSuccessFullLoginWithTwoEmails() throws Exception { checkUserIsSignedIn(token); // Find the user by the second email EPerson ePerson = checkUserWasCreated(null, IDP_TEST_EPERSON, secondEmail, null); + assertTrue(Objects.nonNull(ePerson)); deleteShibbolethUser(ePerson); }