Skip to content

Commit 0e8291e

Browse files
authored
style: include UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_NULL (#7226)
1 parent 1b014a2 commit 0e8291e

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

spotbugs-exclude.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,6 @@
219219
<Match>
220220
<Bug pattern="UTAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE" />
221221
</Match>
222-
<Match>
223-
<Bug pattern="UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NOT_NULL" />
224-
</Match>
225222
<Match>
226223
<Bug pattern="UTAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL" />
227224
</Match>

src/test/java/com/thealgorithms/datastructures/heaps/HeapElementTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import static org.junit.jupiter.api.Assertions.assertEquals;
44
import static org.junit.jupiter.api.Assertions.assertNotEquals;
5+
import static org.junit.jupiter.api.Assertions.assertNotNull;
56
import static org.junit.jupiter.api.Assertions.assertNull;
67

78
import org.junit.jupiter.api.Test;
@@ -39,7 +40,7 @@ void testEquals() {
3940

4041
assertEquals(element1, element2); // Same key and info
4142
assertNotEquals(element1, element3); // Different key
42-
assertNotEquals(null, element1); // Check for null
43+
assertNotNull(element1);
4344
assertNotEquals("String", element1); // Check for different type
4445
}
4546

src/test/java/com/thealgorithms/maths/LinearDiophantineEquationsSolverTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void testSolutionEquality() {
176176
assertEquals(solution1, solution2);
177177
assertNotEquals(solution3, solution1);
178178
assertEquals(solution1, solution1);
179-
assertNotEquals(null, solution1);
179+
assertNotNull(solution1);
180180
assertNotEquals("string", solution1);
181181
}
182182

@@ -217,7 +217,7 @@ void testGcdSolutionWrapperEquality() {
217217
assertEquals(wrapper1, wrapper2);
218218
assertNotEquals(wrapper3, wrapper1);
219219
assertEquals(wrapper1, wrapper1);
220-
assertNotEquals(null, wrapper1);
220+
assertNotNull(wrapper1);
221221
assertNotEquals("string", wrapper1);
222222
}
223223

0 commit comments

Comments
 (0)