// Make it so we return a particular location when asked.
final HRegionLocation loc = new HRegionLocation(hri, sn);
Mockito.when(c.getRegionLocation((TableName) Mockito.any(),
(byte[]) Mockito.any(), Mockito.anyBoolean())).
thenReturn(loc);
Mockito.when(c.locateRegion((TableName) Mockito.any(), (byte[]) Mockito.any())).
thenReturn(loc);
Mockito.when(c.locateRegion((TableName) Mockito.any(), (byte[]) Mockito.any(),
Mockito.anyBoolean(), Mockito.anyBoolean(), Mockito.anyInt()))
.thenReturn(new RegionLocations(loc));
if (admin != null) {