[Test] Renamed PlayerKillTest methods

This commit is contained in:
Rsl1122 2018-10-13 09:52:08 +03:00
parent 82c183e63e
commit 71e2d52967
3 changed files with 120 additions and 69 deletions

View File

@ -154,9 +154,13 @@
<url>https://repo.spongepowered.org/maven</url>
</repository>
<repository>
<id>md_5-snapshots</id>
<url>http://repo.md-5.net/content/repositories/snapshots/</url>
<id>velocity-repo</id>
<url>https://repo.velocitypowered.com/snapshots/</url>
</repository>
<repository>
<id>md_5-snapshots</id>
<url>http://repo.md-5.net/content/repositories/snapshots/</url>
</repository>
<repository>
<id>bstats-repo</id>
<url>http://repo.bstats.org/content/repositories/releases/</url>
@ -300,65 +304,97 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>spongeapi</artifactId>
<version>7.0.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>error_prone_annotations</artifactId>
<groupId>com.google.errorprone</groupId>
</exclusion>
<exclusion>
<artifactId>guice</artifactId>
<groupId>com.google.inject</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.github.ben-manes.caffeine</groupId>
</exclusion>
<exclusion>
<artifactId>plugin-meta</artifactId>
<groupId>org.spongepowered</groupId>
</exclusion>
<exclusion>
<artifactId>configurate-hocon</artifactId>
<groupId>ninja.leaping.configurate</groupId>
</exclusion>
<exclusion>
<artifactId>configurate-gson</artifactId>
<groupId>ninja.leaping.configurate</groupId>
</exclusion>
<exclusion>
<artifactId>configurate-yaml</artifactId>
<groupId>ninja.leaping.configurate</groupId>
</exclusion>
<exclusion>
<artifactId>flow-math</artifactId>
<groupId>com.flowpowered</groupId>
</exclusion>
<exclusion>
<artifactId>flow-noise</artifactId>
<groupId>com.flowpowered</groupId>
</exclusion>
<exclusion>
<artifactId>jsr305</artifactId>
<groupId>com.google.code.findbugs</groupId>
</exclusion>
<exclusion>
<artifactId>asm</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
<exclusion>
<artifactId>gson</artifactId>
<groupId>com.google.code.gson</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
</exclusions>
<groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>text</artifactId>
<groupId>net.kyori</groupId>
</exclusion>
<exclusion>
<artifactId>toml4j</artifactId>
<groupId>com.moandjiezana.toml</groupId>
</exclusion>
<exclusion>
<artifactId>guice</artifactId>
<groupId>com.google.inject</groupId>
</exclusion>
<exclusion>
<artifactId>checker-qual</artifactId>
<groupId>org.checkerframework</groupId>
</exclusion>
<exclusion>
<artifactId>gson</artifactId>
<groupId>com.google.code.gson</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>spongeapi</artifactId>
<version>7.0.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>error_prone_annotations</artifactId>
<groupId>com.google.errorprone</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.github.ben-manes.caffeine</groupId>
</exclusion>
<exclusion>
<artifactId>plugin-meta</artifactId>
<groupId>org.spongepowered</groupId>
</exclusion>
<exclusion>
<artifactId>configurate-hocon</artifactId>
<groupId>ninja.leaping.configurate</groupId>
</exclusion>
<exclusion>
<artifactId>configurate-gson</artifactId>
<groupId>ninja.leaping.configurate</groupId>
</exclusion>
<exclusion>
<artifactId>configurate-yaml</artifactId>
<groupId>ninja.leaping.configurate</groupId>
</exclusion>
<exclusion>
<artifactId>flow-math</artifactId>
<groupId>com.flowpowered</groupId>
</exclusion>
<exclusion>
<artifactId>flow-noise</artifactId>
<groupId>com.flowpowered</groupId>
</exclusion>
<exclusion>
<artifactId>jsr305</artifactId>
<groupId>com.google.code.findbugs</groupId>
</exclusion>
<exclusion>
<artifactId>guice</artifactId>
<groupId>com.google.inject</groupId>
</exclusion>
<exclusion>
<artifactId>asm</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
<exclusion>
<artifactId>gson</artifactId>
<groupId>com.google.code.gson</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.imaginarycode.minecraft</groupId>
<artifactId>RedisBungee</artifactId>

View File

@ -189,7 +189,7 @@ public class PingCountTimerBukkit extends AbsRunnable implements Listener {
if (player.isOnline()) {
addPlayer(player);
}
}// TODO Config
}
}).runTaskLater(TimeAmount.toTicks(config.getNumber(Settings.PING_PLAYER_LOGIN_DELAY), TimeUnit.SECONDS));
}

View File

@ -12,28 +12,43 @@ import utilities.RandomData;
import java.util.UUID;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
/**
* Tests for {@link PlayerKill}.
*
* @author Rsl1122
*/
public class PlayerKillTest {
private String randomString = RandomData.randomString(10);
private String weapon = RandomData.randomString(10);
private UUID testUUID = UUID.randomUUID();
private PlayerKill playerKill = new PlayerKill(testUUID, randomString, 100L);
private PlayerKill underTest = new PlayerKill(testUUID, weapon, 100L);
@Test
public void testGetVictim() {
assertEquals(playerKill.getVictim(), testUUID);
public void victimUUIDIsReturned() {
assertEquals(testUUID, underTest.getVictim());
}
@Test
public void testGetDate() {
assertEquals(playerKill.getDate(), 100L);
public void dateIsReturned() {
assertEquals(100L, underTest.getDate());
}
@Test
public void testGetWeapon() {
assertEquals(playerKill.getWeapon(), randomString);
public void weaponIsReturned() {
assertEquals(weapon, underTest.getWeapon());
}
@Test
public void noVictimFound() {
assertFalse(underTest.getVictimName().isPresent());
}
@Test
public void victimFound() {
String expectedName = "Test Victim";
PlayerKill underTest = new PlayerKill(testUUID, weapon, 100L, expectedName);
assertEquals("Test Victim", underTest.getVictimName().orElse("Unknown"));
}
}