GafferCoprocessor extends BaseRegionObserver { @Override public InternalScanner preFlush(final ObserverContext<RegionCoprocessorEnvironment> e, final Store store, final InternalScanner scanner) throws IOException { return new StoreScanner(scanner, schema, serialisation); }  @Override void start(final CoprocessorEnvironment e); @Override InternalScanner preFlush(final ObserverContext<RegionCoprocessorEnvironment> e,
                                    final Store store,
                                    final InternalScanner scanner); @Override InternalScanner preCompact(final ObserverContext<RegionCoprocessorEnvironment> e,
                                      final Store store,
                                      final InternalScanner scanner,
                                      final ScanType scanType,
                                      final CompactionRequest request); @Override InternalScanner preCompact(final ObserverContext<RegionCoprocessorEnvironment> e,
                                      final Store store,
                                      final InternalScanner scanner,
                                      final ScanType scanType); @Override RegionScanner postScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> e, final Scan scan, final RegionScanner scanner);  }
@Test public void shouldDelegatePreFlushToStoreScanner() throws IOException { final ObserverContext<RegionCoprocessorEnvironment> e = mock(ObserverContext.class); final Store store = mock(Store.class); final InternalScanner scanner = mock(InternalScanner.class); final StoreScanner storeScanner = (StoreScanner) coprocessor.preFlush(e, store, scanner); assertNotNull(storeScanner); }