Skip to content

Commit

Permalink
Make uploads in tests unique
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Mayer <[email protected]>
  • Loading branch information
JonasMayerDev committed Jan 8, 2024
1 parent d868ac5 commit f68aed8
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Random;
import java.util.UUID;

import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
Expand Down Expand Up @@ -174,15 +175,22 @@ private void insertUploads(Account account, int rowsToInsert) {
}
}

public String generateUniqueNumber() {
UUID uuid = UUID.randomUUID();
return uuid.toString();
}

private OCUpload createUpload(Account account) {
OCUpload upload = new OCUpload(File.separator + "very long long long long long long long long long long long " +
"long long long long long long long long long long long long long long " +
"long long long long long long long long long long long long long long " +
"long long long long long long long LocalPath",
"long long long long long long long LocalPath " +
generateUniqueNumber(),
OCFile.PATH_SEPARATOR + "very long long long long long long long long long " +
"long long long long long long long long long long long long long long " +
"long long long long long long long long long long long long long long " +
"long long long long long long long long long long long long RemotePath",
"long long long long long long long long long long long long RemotePath " +
generateUniqueNumber(),
account.name);

upload.setFileSize(new Random().nextInt(20000) * 10000);
Expand Down

0 comments on commit f68aed8

Please sign in to comment.