docs: improve lockable object

This commit is contained in:
Ilkka Seppälä
2024-05-06 19:36:56 +03:00
parent 30cb9af12b
commit 92ae818fe2
10 changed files with 116 additions and 241 deletions
@@ -90,7 +90,7 @@ class CreatureTest {
Assertions.assertEquals(orc, sword.getLocker());
}
void killCreature(Creature source, Creature target) throws InterruptedException {
void killCreature(Creature source, Creature target) {
while (target.isAlive()) {
source.attack(target);
}
@@ -29,17 +29,17 @@ import org.junit.jupiter.api.Test;
class ExceptionsTest {
private String msg = "test";
private static final String MSG = "test";
@Test
void testException(){
Exception e;
try{
throw new LockingException(msg);
throw new LockingException(MSG);
}
catch(LockingException ex){
e = ex;
}
Assertions.assertEquals(msg, e.getMessage());
Assertions.assertEquals(MSG, e.getMessage());
}
}