Search in sources :

Example 6 with ValidationModule

use of com.netflix.conductor.core.config.ValidationModule 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)

Example 7 with ValidationModule

use of com.netflix.conductor.core.config.ValidationModule in project conductor by Netflix.

the class WorkflowBulkServiceTest method before.

@Before
public void before() {
    workflowExecutor = Mockito.mock(WorkflowExecutor.class);
    Injector injector = Guice.createInjector(new AbstractModule() {

        @Override
        protected void configure() {
            bind(WorkflowExecutor.class).toInstance(workflowExecutor);
            install(new ValidationModule());
            bindInterceptor(Matchers.any(), Matchers.annotatedWith(Service.class), new ServiceInterceptor(getProvider(Validator.class)));
        }
    });
    workflowBulkService = injector.getInstance(WorkflowBulkServiceImpl.class);
}
Also used : Injector(com.google.inject.Injector) WorkflowExecutor(com.netflix.conductor.core.execution.WorkflowExecutor) ServiceInterceptor(com.netflix.conductor.interceptors.ServiceInterceptor) ValidationModule(com.netflix.conductor.core.config.ValidationModule) Validator(javax.validation.Validator) AbstractModule(com.google.inject.AbstractModule) Before(org.junit.Before)

Example 8 with ValidationModule

use of com.netflix.conductor.core.config.ValidationModule in project conductor by Netflix.

the class ServerModule method configure.

@Override
protected void configure() {
    install(new CoreModule());
    install(new ValidationModule());
    install(new ArchaiusModule());
    install(new JettyModule());
    install(new GRPCModule());
    install(new EventModule());
    bindInterceptor(Matchers.any(), Matchers.annotatedWith(Service.class), new ServiceInterceptor(getProvider(Validator.class)));
    bind(Configuration.class).to(SystemPropertiesConfiguration.class).in(Scopes.SINGLETON);
    bind(ExecutorService.class).toProvider(ExecutorServiceProvider.class).in(Scopes.SINGLETON);
    bind(WorkflowSweeper.class).asEagerSingleton();
    bind(WorkflowMonitor.class).asEagerSingleton();
}
Also used : GRPCModule(com.netflix.conductor.grpc.server.GRPCModule) EventModule(com.netflix.conductor.core.config.EventModule) WorkflowSweeper(com.netflix.conductor.core.execution.WorkflowSweeper) ArchaiusModule(com.netflix.archaius.guice.ArchaiusModule) JettyModule(com.netflix.conductor.jetty.server.JettyModule) Service(com.netflix.conductor.annotations.Service) ExecutorService(java.util.concurrent.ExecutorService) ServiceInterceptor(com.netflix.conductor.interceptors.ServiceInterceptor) SystemPropertiesConfiguration(com.netflix.conductor.core.config.SystemPropertiesConfiguration) CoreModule(com.netflix.conductor.core.config.CoreModule) WorkflowMonitor(com.netflix.conductor.service.WorkflowMonitor) ValidationModule(com.netflix.conductor.core.config.ValidationModule)

Aggregations

ValidationModule (com.netflix.conductor.core.config.ValidationModule)8 ServiceInterceptor (com.netflix.conductor.interceptors.ServiceInterceptor)7 Before (org.junit.Before)7 AbstractModule (com.google.inject.AbstractModule)6 Injector (com.google.inject.Injector)6 Validator (javax.validation.Validator)6 Configuration (com.netflix.conductor.core.config.Configuration)2 EventQueues (com.netflix.conductor.core.events.EventQueues)2 WorkflowExecutor (com.netflix.conductor.core.execution.WorkflowExecutor)2 MetadataDAO (com.netflix.conductor.dao.MetadataDAO)2 ArchaiusModule (com.netflix.archaius.guice.ArchaiusModule)1 Service (com.netflix.conductor.annotations.Service)1 TaskDef (com.netflix.conductor.common.metadata.tasks.TaskDef)1 CoreModule (com.netflix.conductor.core.config.CoreModule)1 EventModule (com.netflix.conductor.core.config.EventModule)1 SystemPropertiesConfiguration (com.netflix.conductor.core.config.SystemPropertiesConfiguration)1 SimpleEventProcessor (com.netflix.conductor.core.events.SimpleEventProcessor)1 WorkflowSweeper (com.netflix.conductor.core.execution.WorkflowSweeper)1 EventHandlerDAO (com.netflix.conductor.dao.EventHandlerDAO)1 QueueDAO (com.netflix.conductor.dao.QueueDAO)1