File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
src/test/java/org/influxdb/dto Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ package org .influxdb .dto ;
2+
3+ import static org .assertj .core .api .Assertions .assertThat ;
4+
5+ import org .testng .annotations .Test ;
6+
7+ /**
8+ * Test for the Query DTO.
9+ *
10+ * @author jord [at] moz.com
11+ *
12+ */
13+ public class QueryTest {
14+
15+ /**
16+ * Test that equals does what it is supposed to do.
17+ */
18+ @ Test
19+ public void testEqualsAndHashCode () {
20+ String stringA0 = "thesame" ;
21+ String stringA1 = "thesame" ;
22+ String stringB0 = "notthesame" ;
23+
24+ Query queryA0 = new Query (stringA0 , stringA0 );
25+ Query queryA1 = new Query (stringA1 , stringA1 );
26+ Query queryB0 = new Query (stringA0 , stringB0 );
27+ Query queryC0 = new Query (stringB0 , stringA0 );
28+
29+ assertThat (queryA0 ).isEqualTo (queryA1 );
30+ assertThat (queryA0 ).isNotEqualTo (queryB0 );
31+ assertThat (queryB0 ).isNotEqualTo (queryC0 );
32+
33+ assertThat (queryA0 .hashCode ()).isEqualTo (queryA1 .hashCode ());
34+ assertThat (queryA0 .hashCode ()).isNotEqualTo (queryB0 .hashCode ());
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments