Skip to content

Commit 96034ab

Browse files
committed
Fix null check in maze recursion test
1 parent 07ec37a commit 96034ab

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

‎src/test/java/com/thealgorithms/backtracking/MazeRecursionTest.java‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
package com.thealgorithms.backtracking;
22

3-
import static org.junit.jupiter.api.Assertions.assertEquals;
43
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
5-
import static org.junit.jupiter.api.Assertions.assertNotNull;
4+
import static org.junit.jupiter.api.Assertions.assertEquals;
65
import static org.junit.jupiter.api.Assertions.assertNull;
76

87
import org.junit.jupiter.api.Test;
9-
/**
10-
* @author onglipwei
11-
* @create 2022-08-03 5:17 AM
12-
*/
8+
9+
1310
public class MazeRecursionTest {
1411

1512

@@ -41,11 +38,12 @@ public void testCustomStartAndDestination() {
4138
{1, 1, 1, 1, 1}
4239
};
4340

44-
int[][] result = MazeRecursion.solveMazeUsingFirstStrategy(
45-
map, 1, 1, 2, 3
46-
);
41+
int[][] result = MazeRecursion.solveMazeUsingFirstStrategy(map, 1, 1, 2, 3);
42+
43+
if (result == null) {
44+
throw new AssertionError("Expected a solved maze, but got null");
45+
}
4746

48-
assertNotNull(result);
4947
assertEquals(2, result[1][1]);
5048
assertEquals(2, result[2][3]);
5149
}

0 commit comments

Comments
 (0)