refactor: final var
This commit is contained in:
parent
83bc00aebe
commit
153d666b78
2 changed files with 7 additions and 4 deletions
|
@ -24,7 +24,7 @@ public class RandomNameFetcher {
|
|||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(resource))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
String[] values = line.split("\n");
|
||||
final String[] values = line.split("\n");
|
||||
records.add(Arrays.asList(values));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -8,8 +8,9 @@ import org.junit.jupiter.api.Test;
|
|||
import xyz.ineanto.nicko.NickoBukkit;
|
||||
import xyz.ineanto.nicko.appearance.random.RandomNameFetcher;
|
||||
import xyz.ineanto.nicko.config.Configuration;
|
||||
import xyz.ineanto.nicko.mojang.MojangUtils;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class RandomNameTest {
|
||||
private static NickoBukkit plugin;
|
||||
|
@ -25,7 +26,9 @@ public class RandomNameTest {
|
|||
@DisplayName("Get random name")
|
||||
public void getRandomName() {
|
||||
final RandomNameFetcher randomNameFetcher = new RandomNameFetcher(plugin);
|
||||
assertNotNull(randomNameFetcher.getRandomUsername());
|
||||
final String username = randomNameFetcher.getRandomUsername();
|
||||
assertNotNull(username);
|
||||
assertFalse(MojangUtils.isUsernameInvalid(username));
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
|
|
Loading…
Reference in a new issue