[TEST] Don't rely on new Date()

relates elastic/x-pack-elasticsearch#746

Original commit: elastic/x-pack-elasticsearch@11879958b6
This commit is contained in:
Martijn van Groningen 2017-03-20 09:20:05 +01:00
parent bda90063c4
commit 06ce981fed

View File

@ -46,9 +46,16 @@ public class DataCountsTests extends AbstractSerializingTestCase<DataCounts> {
}
public void testCountsHashCode_GivenEqualCounts() {
DataCounts counts1 = createCounts(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
DataCounts counts2 = createCounts(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
DataCounts counts1 = new DataCounts("foo", 1, 2, 3,
4, 5, 6, 7,
8, 9, 10,
new Date(11), new Date(12),
new Date(13), new Date(14), new Date(15));
DataCounts counts2 = new DataCounts("foo", 1, 2, 3,
4, 5, 6, 7,
8, 9, 10,
new Date(11), new Date(12),
new Date(13), new Date(14), new Date(15));
assertEquals(counts1.hashCode(), counts2.hashCode());
}