diff --git a/src/test/java/edu/harvard/iq/dataverse/api/DataRetrieverApiIT.java b/src/test/java/edu/harvard/iq/dataverse/api/DataRetrieverApiIT.java index 0efe2747c73..4e5a8cfada4 100644 --- a/src/test/java/edu/harvard/iq/dataverse/api/DataRetrieverApiIT.java +++ b/src/test/java/edu/harvard/iq/dataverse/api/DataRetrieverApiIT.java @@ -112,10 +112,8 @@ public void testRetrieveMyDataAsJsonString() throws InterruptedException { } // Test getting a list of collections that the user can add datasets to - @Disabled("Temporarily disabled because this integration test is not reliable in CI; re-enable once stabilized. All assertions return one extra dataset than expected.") @Test public void testRetrieveMyDataCollections() throws InterruptedException { - int rootCount = 1; // everyone has access to this dataverse List> items; Response createDataverseResponse; Response retrieveMyCollectionListResponse; @@ -139,6 +137,11 @@ public void testRetrieveMyDataCollections() throws InterruptedException { String User3Username = UtilIT.getUsernameFromResponse(createUserResponse); String User3ApiToken = UtilIT.getApiTokenFromResponse(createUserResponse); + // Get the base number of collections since it's not always 1 for root. + // There may be others left from another test that everyone can access + retrieveMyCollectionListResponse = UtilIT.retrieveMyCollectionList(User1ApiToken, null); + int rootCount = retrieveMyCollectionListResponse.getBody().jsonPath().getList("data.items").size(); + // User1 creates 15 Dataverses and adds a role to each allowing User2 access List dataverses = new ArrayList<>(); int user1DataverseCount = 15;