no.unit.nva.model.testing.associatedartifacts.UnpublishedFileGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nva-datamodel-testutils Show documentation
Show all versions of nva-datamodel-testutils Show documentation
The java version of the NVA datamodel
package no.unit.nva.model.testing.associatedartifacts;
import no.unit.nva.model.Username;
import no.unit.nva.model.associatedartifacts.file.UploadDetails;
import no.unit.nva.model.associatedartifacts.file.UnpublishedFile;
import java.util.UUID;
import no.unit.nva.model.testing.associatedartifacts.util.RightsRetentionStrategyGenerator;
import static no.unit.nva.testutils.RandomDataGenerator.randomInstant;
import static no.unit.nva.testutils.RandomDataGenerator.randomInteger;
import static no.unit.nva.testutils.RandomDataGenerator.randomString;
import static no.unit.nva.testutils.RandomDataGenerator.randomUri;
public final class UnpublishedFileGenerator {
private UnpublishedFileGenerator() {
// NO-OP
}
public static UnpublishedFile random() {
return new UnpublishedFile(UUID.randomUUID(), randomString(), randomString(), randomInteger().longValue(),
randomUri(), false, true, null,
RightsRetentionStrategyGenerator.randomRightsRetentionStrategy(), randomString(),
randomInserted());
}
private static UploadDetails randomInserted() {
return new UploadDetails(randomUsername(), randomInstant());
}
private static Username randomUsername() {
return new Username(randomString());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy