| 169 | } |
| 170 | |
| 171 | @Test |
| 172 | public void testHashCodeandNotEquals() throws Exception { |
| 173 | final TSQuery query = new TSQuery(); |
| 174 | query.setStart("1h-ago"); |
| 175 | final QueryStats stats = new QueryStats(remote, query, headers); |
| 176 | assertNotNull(stats); |
| 177 | final int hash_a = stats.hashCode(); |
| 178 | |
| 179 | final TSQuery query2 = new TSQuery(); |
| 180 | query2.setStart("2h-ago"); |
| 181 | final QueryStats stats2 = new QueryStats(remote, query2, headers); |
| 182 | assertNotNull(stats); |
| 183 | assertTrue(hash_a != stats2.hashCode()); |
| 184 | assertFalse(stats.equals(stats2)); |
| 185 | assertFalse(stats == stats2); |
| 186 | } |
| 187 | |
| 188 | @Test |
| 189 | public void testEqualsNull() throws Exception { |