@Test
public void testRegionLocator() throws IOException {

  assertEquals(1, connection.getAllRegionInfos(TABLE_NAME).size());
  assertEquals(regionInfo, connection.getAllRegionInfos(TABLE_NAME).get(0));
  List<HRegionLocation> expectedRegionLocations =
      ImmutableList.of(new HRegionLocation(regionInfo, ServerName.valueOf(HOST_NAME, port, 0)));
  when(mockSampledAdapter.adaptResponse(Mockito.<List<KeyOffset>>any()))
      .thenReturn(expectedRegionLocations);
  RegionLocator regionLocator = connection.getRegionLocator(TABLE_NAME);
  assertEquals(expectedRegionLocations, regionLocator.getAllRegionLocations());
}