use of org.graylog2.dashboards.widgets.events.WidgetUpdatedEvent in project graylog2-server by Graylog2.
the class WidgetEventsListenerTest method invalidateWidgetResultCacheForWidgetUpdatedMustInvalidateWidgetResultCacheForWidgetId.
@Test
public void invalidateWidgetResultCacheForWidgetUpdatedMustInvalidateWidgetResultCacheForWidgetId() throws Exception {
final String widgetId = "mockedId";
final WidgetUpdatedEvent widgetUpdatedEvent = WidgetUpdatedEvent.create(widgetId);
widgetEventsListener.invalidateWidgetResultCacheForWidgetUpdated(widgetUpdatedEvent);
final ArgumentCaptor<String> widgetIdCaptor = ArgumentCaptor.forClass(String.class);
verify(widgetResultCache).invalidate(widgetIdCaptor.capture());
assertThat(widgetIdCaptor.getValue()).isEqualTo(widgetId);
}
use of org.graylog2.dashboards.widgets.events.WidgetUpdatedEvent in project graylog2-server by Graylog2.
the class DashboardWidgetsResourceTest method verifyWidgetUpdatedEvent.
private void verifyWidgetUpdatedEvent(String widgetId) {
final ArgumentCaptor<WidgetUpdatedEvent> widgetUpdatedEventCaptor = ArgumentCaptor.forClass(WidgetUpdatedEvent.class);
verify(clusterEventBus).post(widgetUpdatedEventCaptor.capture());
final WidgetUpdatedEvent capturedEvent = widgetUpdatedEventCaptor.getValue();
assert (capturedEvent.widgetId()).equals(widgetId);
}
Aggregations