@Test public void testPrepareDoesNotUseCache() throws Exception { TableName tableName = TableName.valueOf("MyTable"); Mockito.when(connection.relocateRegion(tableName, ROW, 0)).thenReturn(regionLocations); ReversedScannerCallable callable = new ReversedScannerCallable(connection, tableName, scan, null, rpcFactory); callable.prepare(true); Mockito.verify(connection).relocateRegion(tableName, ROW, 0); }
@Test public void testPrepareUsesCache() throws Exception { TableName tableName = TableName.valueOf("MyTable"); Mockito.when(connection.locateRegion(tableName, ROW, true, true, 0)) .thenReturn(regionLocations); ReversedScannerCallable callable = new ReversedScannerCallable(connection, tableName, scan, null, rpcFactory); callable.prepare(false); Mockito.verify(connection).locateRegion(tableName, ROW, true, true, 0); } }
@Test public void testPrepareDoesNotUseCache() throws Exception { TableName tableName = TableName.valueOf("MyTable"); Mockito.when(connection.relocateRegion(tableName, ROW, 0)).thenReturn(regionLocations); ReversedScannerCallable callable = new ReversedScannerCallable(connection, tableName, scan, null, rpcFactory); callable.prepare(true); Mockito.verify(connection).relocateRegion(tableName, ROW, 0); }
@Test public void testPrepareUsesCache() throws Exception { TableName tableName = TableName.valueOf("MyTable"); Mockito.when(connection.locateRegion(tableName, ROW, true, true, 0)) .thenReturn(regionLocations); ReversedScannerCallable callable = new ReversedScannerCallable(connection, tableName, scan, null, rpcFactory); callable.prepare(false); Mockito.verify(connection).locateRegion(tableName, ROW, true, true, 0); } }