@Test public void testFlushRegionEntryEquality() { HRegionInfo hri = new HRegionInfo(1, TableName.valueOf("TestTable"), 0); HRegion r = mock(HRegion.class); doReturn(hri).when(r).getRegionInfo(); FlushRegionEntry entry = new FlushRegionEntry(r, true); FlushRegionEntry other = new FlushRegionEntry(r, true); assertEquals(entry.hashCode(), other.hashCode()); assertEquals(entry, other); }
@Test public void test() { HRegion r = Mockito.mock(HRegion.class); FlushRegionEntry entry = new FlushRegionEntry(r); FlushRegionEntry other = new FlushRegionEntry(r); assertEquals(entry.hashCode(), other.hashCode()); assertEquals(entry, other); }
@Test public void testFlushRegionEntryEquality() { RegionInfo hri = RegionInfoBuilder.newBuilder(TableName.valueOf(name.getMethodName())) .setRegionId(1).setReplicaId(0).build(); HRegion r = mock(HRegion.class); doReturn(hri).when(r).getRegionInfo(); FlushRegionEntry entry = new FlushRegionEntry(r, true, FlushLifeCycleTracker.DUMMY); FlushRegionEntry other = new FlushRegionEntry(r, true, FlushLifeCycleTracker.DUMMY); assertEquals(entry.hashCode(), other.hashCode()); assertEquals(entry, other); }