Skip to content

Commit

Permalink
#8184 fix existing test
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Oct 16, 2024
1 parent 53e2f0e commit 57960c6
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
import edu.harvard.iq.dataverse.search.IndexServiceBean;
import edu.harvard.iq.dataverse.search.SolrIndexServiceBean;
import edu.harvard.iq.dataverse.util.SystemConfig;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.Future;

Expand Down Expand Up @@ -195,22 +197,25 @@ public void testCreateAnonymizedAccessPrivateUrlSuccessfully() throws CommandExc
}

@Test
public void testAttemptCreateAnonymizedAccessPrivateUrlOnReleased() {
public void testAttemptCreateAnonymizedAccessPrivateUrlOnReleased() throws CommandException {
dataset = new Dataset();
List<DatasetVersion> versions = new ArrayList<>();
dataset.setPublicationDate(new Timestamp(new Date().getTime()));
DatasetVersion datasetVersion = new DatasetVersion();
datasetVersion.setVersionState(DatasetVersion.VersionState.RELEASED);
DatasetVersion datasetVersion2 = new DatasetVersion();

versions.add(datasetVersion);
datasetVersion2.setVersionState(DatasetVersion.VersionState.DRAFT);

versions.add(datasetVersion2);
versions.add(datasetVersion);
dataset.setVersions(versions);
dataset.setId(versionIsReleased);
PrivateUrl privateUrl = null;
try {
privateUrl = testEngine.submit(new CreatePrivateUrlCommand(null, dataset, true));
assertTrue(false);
} catch (CommandException ex) {

}
assertNull(privateUrl);
}
Expand Down

0 comments on commit 57960c6

Please sign in to comment.