@Test public void setInCache() { List<CompositeEvent> events = Arrays.asList(mock(CompositeEvent.class), mock(CompositeEvent.class), mock(CompositeEvent.class)); this.defaultNotificationCacheManager.setInCache("mykey", events, false); verify(this.longEventCache).set("mykey", events); verify(this.longCountCache, never()).set("mykey", events); this.defaultNotificationCacheManager.setInCache("anotherkey", events, true); verify(this.longEventCache, never()).set("anotherkey", 3); verify(this.longCountCache).set("anotherkey", 3); verify(this.configuration, times(3)).isRestCacheEnabled(); }
public void setInCache(String cacheKey, List<CompositeEvent> events, boolean count) { if (this.configuration.isRestCacheEnabled()) { if (count) { this.longCountCache.set(cacheKey, events.size()); } else { this.longEventCache.set(cacheKey, events); } } }
DefaultNotificationCacheManager implements Initializable, Disposable { public void setInCache(String cacheKey, List<CompositeEvent> events, boolean count) { if (this.configuration.isRestCacheEnabled()) { if (count) { this.longCountCache.set(cacheKey, events.size()); } else { this.longEventCache.set(cacheKey, events); } } } }
DefaultNotificationCacheManager implements Initializable, Disposable { public void setInCache(String cacheKey, List<CompositeEvent> events, boolean count) { if (this.configuration.isRestCacheEnabled()) { if (count) { this.longCountCache.set(cacheKey, events.size()); } else { this.longEventCache.set(cacheKey, events); } } }  }
DefaultNotificationCacheManager implements Initializable, Disposable { public void setInCache(String cacheKey, List<CompositeEvent> events, boolean count) { if (this.configuration.isRestCacheEnabled()) { if (count) { this.longCountCache.set(cacheKey, events.size()); } else { this.longEventCache.set(cacheKey, events); } } }  @Override void initialize(); String createCacheKey(NotificationParameters notificationParameters); Object getFromCache(String cacheKey, boolean count); void setInCache(String cacheKey, List<CompositeEvent> events, boolean count); void flushLongCache(); @Override void dispose(); }
DefaultNotificationCacheManager implements Initializable, Disposable { public void setInCache(String cacheKey, List<CompositeEvent> events, boolean count) { if (this.configuration.isRestCacheEnabled()) { if (count) { this.longCountCache.set(cacheKey, events.size()); } else { this.longEventCache.set(cacheKey, events); } } }  @Override void initialize(); String createCacheKey(NotificationParameters notificationParameters); Object getFromCache(String cacheKey, boolean count); void setInCache(String cacheKey, List<CompositeEvent> events, boolean count); void flushLongCache(); @Override void dispose();  }