public void testFilteredEventsReplay() {
final StaticFilteredEventLogListener<Integer> staticEventListener = new StaticFilteredEventLogListener<>();
RemoteCache<Integer, String> cache = remoteCacheManager.getCache();
cache.put(1, "one");
cache.put(2, "two");
withClientListener(staticEventListener, new RemoteCacheManagerCallable(remoteCacheManager) {
@Override
public void call() {
staticEventListener.expectOnlyCreatedEvent(2, cache());
RemoteCache<Integer, String> cache = rcm.getCache();
cache.remove(1);
cache.remove(2);
staticEventListener.expectOnlyRemovedEvent(2, cache());
}
});
final DynamicFilteredEventLogListener<Integer> dynamicEventListener = new DynamicFilteredEventLogListener<>();
cache.put(1, "one");
cache.put(2, "two");
cache.put(3, "three");
withClientListener(dynamicEventListener, new Object[]{3}, null, new RemoteCacheManagerCallable(remoteCacheManager) {
@Override
public void call() {
dynamicEventListener.expectOnlyCreatedEvent(3, cache());
RemoteCache<Integer, String> cache = rcm.getCache();
cache.remove(1);