Skip to content
Snippets Groups Projects
Commit b2584c6e authored by Trym Gudvangen's avatar Trym Gudvangen
Browse files

refactor: change tests that used @NotNull

parent 69bb17cd
No related branches found
No related tags found
1 merge request!3feat: part one
Pipeline #230350 passed
......@@ -41,11 +41,11 @@ class GoldActionTest {
}
@Test
public void throws_IllegalArgumentException_executing_with_null_argument() {
public void throws_NullPointerException_executing_with_null_argument() {
GoldAction goldAction = new GoldAction(10);
Player player = null;
assertThrows(IllegalArgumentException.class, () -> goldAction.execute(player));
assertThrows(NullPointerException.class, () -> goldAction.execute(player));
}
}
......
......@@ -41,11 +41,11 @@ class HealthActionTest {
}
@Test
public void throws_IllegalArgumentException_executing_with_null_argument() {
public void throws_NullPointerException_executing_with_null_argument() {
HealthAction healthAction = new HealthAction(10);
Player player = null;
assertThrows(IllegalArgumentException.class, () -> healthAction.execute(player));
assertThrows(NullPointerException.class, () -> healthAction.execute(player));
}
}
......
......@@ -44,11 +44,11 @@ class InventoryActionTest {
}
@Test
public void throws_IllegalArgumentException_executing_with_null_argument() {
public void throws_NullPointerException_executing_with_null_argument() {
InventoryAction inventoryAction = new InventoryAction("Apple");
Player player = null;
assertThrows(IllegalArgumentException.class, () -> inventoryAction.execute(player));
assertThrows(NullPointerException.class, () -> inventoryAction.execute(player));
}
}
......
......@@ -41,11 +41,11 @@ class ScoreActionTest {
}
@Test
public void throws_IllegalArgumentException_executing_with_null_argument() {
public void throws_NullPointerException_executing_with_null_argument() {
ScoreAction scoreAction = new ScoreAction(10);
Player player = null;
assertThrows(IllegalArgumentException.class, () -> scoreAction.execute(player));
assertThrows(NullPointerException.class, () -> scoreAction.execute(player));
}
}
......
......@@ -52,11 +52,11 @@ class GoldGoalTest {
}
@Test
public void throws_IllegalArgumentException_checking_with_null_as_player() {
public void throws_NullPointerException_checking_with_null_as_player() {
GoldGoal goldGoal = new GoldGoal(10);
Player player = null;
assertThrows(IllegalArgumentException.class, () -> goldGoal.isFulfilled(player));
assertThrows(NullPointerException.class, () -> goldGoal.isFulfilled(player));
}
}
......
......@@ -52,11 +52,11 @@ class HealthGoalTest {
}
@Test
public void throws_IllegalArgumentException_checking_with_null_as_player() {
public void throws_NullPointerException_checking_with_null_as_player() {
HealthGoal healthGoal = new HealthGoal(10);
Player player = null;
assertThrows(IllegalArgumentException.class, () -> healthGoal.isFulfilled(player));
assertThrows(NullPointerException.class, () -> healthGoal.isFulfilled(player));
}
@Test
......
......@@ -58,11 +58,11 @@ class InventoryGoalTest {
}
@Test
public void throws_IllegalArgumentException_checking_with_null_as_player() {
public void throws_NullPointerException_checking_with_null_as_player() {
InventoryGoal inventoryGoal = new InventoryGoal(getMandatoryInventory());
Player player = null;
assertThrows(IllegalArgumentException.class, () -> inventoryGoal.isFulfilled(player));
assertThrows(NullPointerException.class, () -> inventoryGoal.isFulfilled(player));
}
}
......
......@@ -51,11 +51,11 @@ class ScoreGoalTest {
}
@Test
public void throws_IllegalArgumentException_checking_with_null_as_player() {
public void throws_NullPointerException_checking_with_null_as_player() {
ScoreGoal scoreGoal = new ScoreGoal(10);
Player player = null;
assertThrows(IllegalArgumentException.class, () -> scoreGoal.isFulfilled(player));
assertThrows(NullPointerException.class, () -> scoreGoal.isFulfilled(player));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment