super.setup();
TroveUtils utils= new TroveUtils(api);
for (String zone : api.getConfiguredZones()) {
// create instances
List<Instance> instanceList = Lists.newArrayList();
Instance first = utils.getWorkingInstance(zone, "first_user_trove_live_testing_" + zone, "1", 1);
Instance second = utils.getWorkingInstance(zone, "second_user_trove_live_testing_" + zone, "1", 1);
instanceList.add(first);
instanceList.add(second);
instancesToDelete.put(zone, instanceList);
// create users
User user1 = User.builder()
.name("user1")
.password(UUID.randomUUID().toString())
.databases(ImmutableSet.of(
"u1db1",
"u1db2")).build();
User user2 = User.builder()
.name("user2")
.password(UUID.randomUUID().toString())
.databases(ImmutableSet.of(
"u2db1",
"u2db2")).build();
User user3 = User.builder()
.name("user3")
.password(UUID.randomUUID().toString())
.host("173.203.44.122")
.databases(ImmutableSet.of(
"u3db1",
"u3db2")).build();
UserApi userApiFirst = api.getUserApiForInstanceInZone(first.getId(), zone);
UserApi userApiSecond = api.getUserApiForInstanceInZone(second.getId(), zone);
userApiFirst.create(ImmutableSet.of(user1, user2));
userApiSecond.create(ImmutableSet.of(user3));
}
}