Search in sources :

Example 1 with EventTypeMetricRegistry

use of org.zalando.nakadi.metrics.EventTypeMetricRegistry in project nakadi by zalando.

the class EventPublishingControllerTest method setUp.

@Before
public void setUp() {
    metricRegistry = new MetricRegistry();
    publisher = mock(EventPublisher.class);
    eventTypeMetricRegistry = new EventTypeMetricRegistry(metricRegistry);
    kpiPublisher = mock(NakadiKpiPublisher.class);
    settings = mock(SecuritySettings.class);
    when(settings.getAuthMode()).thenReturn(OFF);
    when(settings.getAdminClientId()).thenReturn("nakadi");
    blacklistService = Mockito.mock(BlacklistService.class);
    when(blacklistService.isProductionBlocked(any(), any())).thenReturn(false);
    final FeatureToggleService featureToggleService = Mockito.mock(FeatureToggleService.class);
    final EventPublishingController controller = new EventPublishingController(publisher, eventTypeMetricRegistry, blacklistService, kpiPublisher, "kpiEventTypeName");
    mockMvc = standaloneSetup(controller).setMessageConverters(new StringHttpMessageConverter(), TestUtils.JACKSON_2_HTTP_MESSAGE_CONVERTER).setCustomArgumentResolvers(new ClientResolver(settings, featureToggleService)).build();
}
Also used : EventPublisher(org.zalando.nakadi.service.EventPublisher) FeatureToggleService(org.zalando.nakadi.service.FeatureToggleService) BlacklistService(org.zalando.nakadi.service.BlacklistService) EventTypeMetricRegistry(org.zalando.nakadi.metrics.EventTypeMetricRegistry) MetricRegistry(com.codahale.metrics.MetricRegistry) NakadiKpiPublisher(org.zalando.nakadi.service.NakadiKpiPublisher) SecuritySettings(org.zalando.nakadi.config.SecuritySettings) ClientResolver(org.zalando.nakadi.security.ClientResolver) StringHttpMessageConverter(org.springframework.http.converter.StringHttpMessageConverter) EventTypeMetricRegistry(org.zalando.nakadi.metrics.EventTypeMetricRegistry) Before(org.junit.Before)

Aggregations

MetricRegistry (com.codahale.metrics.MetricRegistry)1 Before (org.junit.Before)1 StringHttpMessageConverter (org.springframework.http.converter.StringHttpMessageConverter)1 SecuritySettings (org.zalando.nakadi.config.SecuritySettings)1 EventTypeMetricRegistry (org.zalando.nakadi.metrics.EventTypeMetricRegistry)1 ClientResolver (org.zalando.nakadi.security.ClientResolver)1 BlacklistService (org.zalando.nakadi.service.BlacklistService)1 EventPublisher (org.zalando.nakadi.service.EventPublisher)1 FeatureToggleService (org.zalando.nakadi.service.FeatureToggleService)1 NakadiKpiPublisher (org.zalando.nakadi.service.NakadiKpiPublisher)1