Fixed test compilation

This commit is contained in:
Risto Lahtela 2021-03-16 09:42:50 +02:00
parent 2e01758fd6
commit c54c3ce88b
2 changed files with 10 additions and 9 deletions

View File

@ -45,7 +45,7 @@ public interface UserInfoQueriesTest extends DatabaseTestPreparer {
db().executeTransaction(new PlayerServerRegisterTransaction(playerUUID, () -> TestConstants.REGISTER_TIME, TestConstants.PLAYER_ONE_NAME, serverUUID(), TestConstants.PLAYER_HOSTNAME));
List<UserInfo> userInfo = db().query(UserInfoQueries.fetchUserInformationOfUser(playerUUID));
List<UserInfo> expected = Collections.singletonList(new UserInfo(playerUUID, serverUUID(), TestConstants.REGISTER_TIME, false, TestConstants.PLAYER_HOSTNAME, false));
List<UserInfo> expected = Collections.singletonList(new UserInfo(playerUUID, serverUUID(), TestConstants.REGISTER_TIME, false, TestConstants.PLAYER_HOSTNAME.get(), false));
assertEquals(expected, userInfo);
}
@ -58,7 +58,7 @@ public interface UserInfoQueriesTest extends DatabaseTestPreparer {
db().executeTransaction(new BanStatusTransaction(playerUUID, () -> true));
List<UserInfo> userInfo = db().query(UserInfoQueries.fetchUserInformationOfUser(playerUUID));
List<UserInfo> expected = Collections.singletonList(new UserInfo(playerUUID, serverUUID(), TestConstants.REGISTER_TIME, false, TestConstants.PLAYER_HOSTNAME, true));
List<UserInfo> expected = Collections.singletonList(new UserInfo(playerUUID, serverUUID(), TestConstants.REGISTER_TIME, false, TestConstants.PLAYER_HOSTNAME.get(), true));
assertEquals(expected, userInfo);
}
@ -71,7 +71,7 @@ public interface UserInfoQueriesTest extends DatabaseTestPreparer {
db().executeTransaction(new OperatorStatusTransaction(playerUUID, true));
List<UserInfo> userInfo = db().query(UserInfoQueries.fetchUserInformationOfUser(playerUUID));
List<UserInfo> expected = Collections.singletonList(new UserInfo(playerUUID, serverUUID(), TestConstants.REGISTER_TIME, true, TestConstants.PLAYER_HOSTNAME, false));
List<UserInfo> expected = Collections.singletonList(new UserInfo(playerUUID, serverUUID(), TestConstants.REGISTER_TIME, true, TestConstants.PLAYER_HOSTNAME.get(), false));
assertEquals(expected, userInfo);
}
@ -180,11 +180,11 @@ public interface UserInfoQueriesTest extends DatabaseTestPreparer {
@Override
protected void performOperations() {
execute(DataStoreQueries.registerUserInfo(playerUUID, 0L,
serverUUID(), TestConstants.PLAYER_HOSTNAME));
serverUUID(), TestConstants.PLAYER_HOSTNAME.get()));
execute(DataStoreQueries.registerUserInfo(playerUUID, 0L,
serverUUID(), TestConstants.PLAYER_HOSTNAME));
serverUUID(), TestConstants.PLAYER_HOSTNAME.get()));
execute(DataStoreQueries.registerUserInfo(player2UUID, 0L,
serverUUID(), TestConstants.PLAYER_HOSTNAME));
serverUUID(), TestConstants.PLAYER_HOSTNAME.get()));
}
}).get();
@ -192,13 +192,13 @@ public interface UserInfoQueriesTest extends DatabaseTestPreparer {
List<UserInfo> found = db().query(UserInfoQueries.fetchUserInformationOfUser(playerUUID));
assertEquals(
Collections.singletonList(new UserInfo(playerUUID, serverUUID(), 0, false, TestConstants.PLAYER_HOSTNAME, false)),
Collections.singletonList(new UserInfo(playerUUID, serverUUID(), 0, false, TestConstants.PLAYER_HOSTNAME.get(), false)),
found
);
List<UserInfo> found2 = db().query(UserInfoQueries.fetchUserInformationOfUser(player2UUID));
assertEquals(
Collections.singletonList(new UserInfo(player2UUID, serverUUID(), 0, false, TestConstants.PLAYER_HOSTNAME,false)),
Collections.singletonList(new UserInfo(player2UUID, serverUUID(), 0, false, TestConstants.PLAYER_HOSTNAME.get(), false)),
found2
);
}

View File

@ -19,6 +19,7 @@ package utilities;
import com.djrapitops.plan.identification.ServerUUID;
import java.util.UUID;
import java.util.function.Supplier;
/**
* Test Constants go here.
@ -43,7 +44,7 @@ public class TestConstants {
public static final String PLAYER_TWO_NAME = "Test_Player_two";
public static final String PLAYER_THREE_NAME = RandomData.randomString(16);
public static final String PLAYER_HOSTNAME = "play.example.com";
public static final Supplier<String> PLAYER_HOSTNAME = () -> "play.example.com";
public static final String WORLD_ONE_NAME = "World One";
public static final Long REGISTER_TIME = RandomData.randomTime();