1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-05 23:22:47 +00:00

Fixed test-smells

This commit is contained in:
2021-03-22 16:10:44 -03:00
parent 2d50dec487
commit 62574ee0ec
3 changed files with 7 additions and 7 deletions

View File

@@ -52,9 +52,9 @@ public class BitSetIDAllocatorTest {
public void testAllocate() { public void testAllocate() {
final int id1 = allocator.allocate(); final int id1 = allocator.allocate();
final int id2 = allocator.allocate(); final int id2 = allocator.allocate();
assertFalse(id1 == id2); assertFalse("IDs must not be equal", id1 == id2);
assertEquals(IDAllocator.FIRST_ID, id1); assertEquals("First allocated ID must be equal to the first allocatable ID", IDAllocator.FIRST_ID, id1);
assertEquals(IDAllocator.FIRST_ID + 1, id2); assertEquals("IDs must increment sequentially", IDAllocator.FIRST_ID + 1, id2);
} }
/** /**

View File

@@ -70,8 +70,8 @@ public class CharacterIDProviderTest {
public void testCreateID() { public void testCreateID() {
final ID<Integer> id1 = charIdFactory.createID(); final ID<Integer> id1 = charIdFactory.createID();
final ID<Integer> id2 = charIdFactory.createID(); final ID<Integer> id2 = charIdFactory.createID();
Assert.assertNotNull(id1); Assert.assertNotNull("Must return a valid ID.", id1);
Assert.assertFalse(id1.equals(id2)); Assert.assertFalse("Must allocate unique IDs.", id1.equals(id2));
} }
/** /**
@@ -82,6 +82,7 @@ public class CharacterIDProviderTest {
final CharacterID id1 = charIdFactory.createID(); final CharacterID id1 = charIdFactory.createID();
Assert.assertNotNull(id1); Assert.assertNotNull(id1);
charIdFactory.destroy(id1); charIdFactory.destroy(id1);
Assert.assertNull(charIdFactory.resolveID(id1.getID()));
} }
/** /**

View File

@@ -78,8 +78,7 @@ public class WorldServiceImplTest {
*/ */
@Test(expected = NullPointerException.class) @Test(expected = NullPointerException.class)
public void testAddNullId() { public void testAddNullId() {
final L2Character character = new L2Character(null); world.add(null);
world.add(character);
} }
/** /**