minor change

This commit is contained in:
Luca Frosini 2021-03-17 15:49:05 +01:00
parent 7cbfc33ecf
commit f77e7ffa22
1 changed files with 3 additions and 6 deletions

View File

@ -63,6 +63,7 @@ public class PersistencePostgreSQLTest extends ContextTest {
public static final int maxDuration = 450;
private static final Random random;
static {
random = new Random();
minutesInAnYear = (int) TimeUnit.DAYS.toMinutes(365);
@ -79,13 +80,9 @@ public class PersistencePostgreSQLTest extends ContextTest {
serviceUsageRecord.setHost("host" + (25-randomNumber) + ".d4science.org");
}
public static String getRandomUser() {
int randomNumber = random.nextInt(users.length);
return users[randomNumber];
}
public static void setConsumerId(AggregatedServiceUsageRecord serviceUsageRecord) throws Exception {
serviceUsageRecord.setConsumerId(getRandomUser());
int randomNumber = random.nextInt(users.length);
serviceUsageRecord.setConsumerId(users[randomNumber]);
}
public static void setServiceClassAndName(AggregatedServiceUsageRecord serviceUsageRecord) throws Exception {