super.setup();
TroveUtils utils = new TroveUtils(api);
for (String region : api.getConfiguredRegions()) {
// create instances
List<Instance> instanceList = Lists.newArrayList();
Instance first = utils.getWorkingInstance(region, "first_user_trove_live_testing_" + region, "1", 1);
Instance second = utils.getWorkingInstance(region, "second_user_trove_live_testing_" + region, "1", 1);
instanceList.add(first);
instanceList.add(second);
instancesToDelete.put(region, 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.getUserApi(region, first.getId());
UserApi userApiSecond = api.getUserApi(region, second.getId());
userApiFirst.create(ImmutableSet.of(user1, user2));
userApiSecond.create(ImmutableSet.of(user3));
}
}