JdbcWriter extends AbstractJdbcCallback implements CacheWriter<K, V> { @Override public void beforeDestroy(EntryEvent<K, V> event) throws CacheWriterException { writeEvent(event); } @SuppressWarnings("unused")  JdbcWriter();   JdbcWriter(SqlHandler sqlHandler, InternalCache cache); @Override void beforeUpdate(EntryEvent<K, V> event); @Override void beforeCreate(EntryEvent<K, V> event); @Override void beforeDestroy(EntryEvent<K, V> event); @Override void beforeRegionDestroy(RegionEvent<K, V> event); @Override void beforeRegionClear(RegionEvent<K, V> event);  }
@SuppressWarnings("unchecked") @Test public void beforeDestroyWithDestroyEventWritesToSqlHandler() throws Exception { when(entryEvent.getOperation()).thenReturn(Operation.DESTROY); when(entryEvent.getSerializedNewValue()).thenReturn(null); writer.beforeDestroy(entryEvent); verify(sqlHandler, times(1)).write(eq(region), eq(Operation.DESTROY), eq(key), eq(null)); }