1
2
3
4
5 package com.qulice.pmd;
6
7 import org.hamcrest.Matchers;
8 import org.junit.jupiter.api.Test;
9
10
11
12
13
14
15
16 final class PmdCompareObjectsWithEqualsTest {
17
18 @Test
19 void allowsComparingFuturesByReference() throws Exception {
20 new PmdAssert(
21 "CompareFuturesWithEquals.java",
22 Matchers.any(Boolean.class),
23 Matchers.not(
24 Matchers.containsString("(CompareObjectsWithEquals)")
25 )
26 ).assertOk();
27 }
28
29 @Test
30 void forbidsComparingPlainObjectsByReference() throws Exception {
31 new PmdAssert(
32 "CompareObjectsByReference.java",
33 Matchers.is(false),
34 Matchers.containsString("(CompareObjectsWithEquals)")
35 ).assertOk();
36 }
37 }