Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,14 @@ public void testRetrieveMyDataCollections() throws InterruptedException {
// The count should show the list size to be only Root Dataverse count
items = retrieveMyCollectionListResponse.getBody().jsonPath().getList("data.items");
assertEquals(rootCount, items.size());
// Verify the name and alias of the Root Dataverse. We don't know the id so just make sure it's in the response
assertNotNull(items.get(0).get("id"));
assertEquals("Root", items.get(0).get("name"));
assertEquals("root", items.get(0).get("alias"));
// Verify the alias of the Root Dataverse is in the response
boolean found = false;
for (int i = 0; i < items.size(); i++) {
if ("root".equalsIgnoreCase(items.get(i).get("alias"))) {
found = true;
}
}
assertTrue(found, "Root dataverse not found in my collection list");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertTrue expects "found" to be true. And "found" is set to true when the root dataverse is found right? So shouldn't the message say "Root dataverse WAS found" rather than "NOT found"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert only displays the string when the test fails. I.e. if found = false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, ok, thanks! Merging!


// Superuser gets the list of Dataverses/Collections it has access to
retrieveMyCollectionListResponse = UtilIT.retrieveMyCollectionList(superUserApiToken, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void testCreateFeaturedItemWithDvOdbject() {
}

@Test
public void testCreateFeaturedItemWithBadDvOdbjectIds() {
public void testCreateFeaturedItemWithBadDvObjectIds() {
// Set up a new published dataverse and dataset
String apiToken = createUserAndGetApiToken();
String dataverseAlias = createDataverseAndGetAlias(apiToken);
Expand All @@ -100,7 +100,7 @@ public void testCreateFeaturedItemWithBadDvOdbjectIds() {
UtilIT.publishDatasetViaNativeApi(datasetId, "major", apiToken).prettyPrint();
String datasetPersistentIdBad = datasetPersistentId + "BAD";
String dataverseAliasBad = dataverseAlias + "BAD";
String fieldIdBad = "999";
String fieldIdBad = String.valueOf(Integer.MAX_VALUE);

// Test with bad Dataset id should return bad request with not found message
Response createFeatureItemResponse = UtilIT.createDataverseFeaturedItem(dataverseAlias, apiToken, null, 0, null, "dataset", datasetPersistentIdBad);
Expand Down
Loading