JdbcWriter extends AbstractJdbcCallback implements CacheWriter<K, V> { @Override public void beforeUpdate(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 beforeUpdateWithPdxInstanceWritesToSqlHandler() throws Exception { writer.beforeUpdate(entryEvent); verify(sqlHandler, times(1)).write(eq(region), eq(Operation.CREATE), eq(key), eq(pdxInstance)); }
@Test public void beforeUpdateWithoutPdxInstanceWritesToSqlHandler() { when(serializedNewValue.getDeserializedValue()).thenReturn(new Object()); assertThatThrownBy(() -> writer.beforeUpdate(entryEvent)) .isInstanceOf(IllegalArgumentException.class); }