Search in sources :

Example 1 with EventHandlerDAO

use of com.netflix.conductor.dao.EventHandlerDAO in project conductor by Netflix.

the class MetadataServiceTest method before.

@Before
public void before() {
    metadataDAO = Mockito.mock(MetadataDAO.class);
    eventHandlerDAO = Mockito.mock(EventHandlerDAO.class);
    eventQueues = Mockito.mock(EventQueues.class);
    configuration = Mockito.mock(Configuration.class);
    when(configuration.isOwnerEmailMandatory()).thenReturn(true);
    Injector injector = Guice.createInjector(new AbstractModule() {

        @Override
        protected void configure() {
            bind(MetadataDAO.class).toInstance(metadataDAO);
            bind(EventHandlerDAO.class).toInstance(eventHandlerDAO);
            bind(EventQueues.class).toInstance(eventQueues);
            bind(Configuration.class).toInstance(configuration);
            install(new ValidationModule());
            bindInterceptor(Matchers.any(), Matchers.annotatedWith(Service.class), new ServiceInterceptor(getProvider(Validator.class)));
        }
    });
    metadataService = injector.getInstance(MetadataServiceImpl.class);
}
Also used : Configuration(com.netflix.conductor.core.config.Configuration) Injector(com.google.inject.Injector) EventQueues(com.netflix.conductor.core.events.EventQueues) ServiceInterceptor(com.netflix.conductor.interceptors.ServiceInterceptor) ValidationModule(com.netflix.conductor.core.config.ValidationModule) EventHandlerDAO(com.netflix.conductor.dao.EventHandlerDAO) Validator(javax.validation.Validator) MetadataDAO(com.netflix.conductor.dao.MetadataDAO) AbstractModule(com.google.inject.AbstractModule) Before(org.junit.Before)

Aggregations

AbstractModule (com.google.inject.AbstractModule)1 Injector (com.google.inject.Injector)1 Configuration (com.netflix.conductor.core.config.Configuration)1 ValidationModule (com.netflix.conductor.core.config.ValidationModule)1 EventQueues (com.netflix.conductor.core.events.EventQueues)1 EventHandlerDAO (com.netflix.conductor.dao.EventHandlerDAO)1 MetadataDAO (com.netflix.conductor.dao.MetadataDAO)1 ServiceInterceptor (com.netflix.conductor.interceptors.ServiceInterceptor)1 Validator (javax.validation.Validator)1 Before (org.junit.Before)1