Skip to content

Commit d5e2cda

Browse files
authored
Merge pull request #12372 from IQSS/12371-fix-dataretriever-api-test-for-github
Fix DataRetrieverApiIT.testRetrieveMyDataCollections() for github mig…
2 parents 1cec97b + a5a5410 commit d5e2cda

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/test/java/edu/harvard/iq/dataverse/api/DataRetrieverApiIT.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,8 @@ public void testRetrieveMyDataAsJsonString() throws InterruptedException {
112112
}
113113

114114
// Test getting a list of collections that the user can add datasets to
115-
@Disabled("Temporarily disabled because this integration test is not reliable in CI; re-enable once stabilized. All assertions return one extra dataset than expected.")
116115
@Test
117116
public void testRetrieveMyDataCollections() throws InterruptedException {
118-
int rootCount = 1; // everyone has access to this dataverse
119117
List<Map<String, String>> items;
120118
Response createDataverseResponse;
121119
Response retrieveMyCollectionListResponse;
@@ -139,6 +137,11 @@ public void testRetrieveMyDataCollections() throws InterruptedException {
139137
String User3Username = UtilIT.getUsernameFromResponse(createUserResponse);
140138
String User3ApiToken = UtilIT.getApiTokenFromResponse(createUserResponse);
141139

140+
// Get the base number of collections since it's not always 1 for root.
141+
// There may be others left from another test that everyone can access
142+
retrieveMyCollectionListResponse = UtilIT.retrieveMyCollectionList(User1ApiToken, null);
143+
int rootCount = retrieveMyCollectionListResponse.getBody().jsonPath().getList("data.items").size();
144+
142145
// User1 creates 15 Dataverses and adds a role to each allowing User2 access
143146
List<String> dataverses = new ArrayList<>();
144147
int user1DataverseCount = 15;

0 commit comments

Comments
 (0)