Commit 23bf55fa authored by Alexander Sommer's avatar Alexander Sommer
Browse files

Add usage of incrementing id rather than random one for better readability

parent 6089b821
......@@ -40,6 +40,7 @@ public class CaseCreator {
pairs.add(new TestPair("login-admin tester;123123123", "OK"));
Vector<String> ids = new Vector<>();
int idCounter = 0;
Vector<String> countries = new Vector<>();
......@@ -55,10 +56,7 @@ public class CaseCreator {
} while (countries.contains(country));
countries.add(country);
String id;
do {
id = randomString("123456789", 3);
} while (ids.contains(id));
String id = String.format("%03d", ++idCounter);
ids.add(id);
pairs.add(new TestPair("add-ioc-code " + id + ";" + countries.elementAt(2 * i + 1) + ";"
......@@ -90,10 +88,7 @@ public class CaseCreator {
for (int s = 0; s < nSports; s++) {
athletes.add(new Vector<>());
for (int a = 0; a < nAthletes; a++) {
String id;
do {
id = randomString("0123456789", 4);
} while (ids.contains(id) || id.equals("0000"));
String id = String.format("%03d", ++idCounter);
ids.add(id);
String country = countries.elementAt(2 * random.nextInt(nCountries));
athletes.elementAt(s).add(id);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment