use of com.netflix.conductor.interceptors.ServiceInterceptor in project conductor by Netflix.
the class EventServiceTest method before.
@Before
public void before() {
metadataService = Mockito.mock(MetadataService.class);
eventProcessor = Mockito.mock(SimpleEventProcessor.class);
eventQueues = Mockito.mock(EventQueues.class);
Injector injector = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
bind(MetadataService.class).toInstance(metadataService);
bind(EventProcessor.class).toInstance(eventProcessor);
bind(EventQueues.class).toInstance(eventQueues);
install(new ValidationModule());
bindInterceptor(Matchers.any(), Matchers.annotatedWith(Service.class), new ServiceInterceptor(getProvider(Validator.class)));
}
});
eventService = injector.getInstance(EventServiceImpl.class);
}
use of com.netflix.conductor.interceptors.ServiceInterceptor in project conductor by Netflix.
the class MetadataMapperServiceTest method before.
@Before
public void before() {
metadataMapperService = Mockito.mock(MetadataMapperService.class);
Injector injector = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
bind(MetadataDAO.class).toInstance(metadataDAO);
install(new ValidationModule());
bindInterceptor(Matchers.any(), Matchers.annotatedWith(Service.class), new ServiceInterceptor(getProvider(Validator.class)));
}
});
metadataMapperService = injector.getInstance(MetadataMapperService.class);
}
use of com.netflix.conductor.interceptors.ServiceInterceptor in project conductor by Netflix.
the class TaskServiceTest method before.
@Before
public void before() {
executionService = Mockito.mock(ExecutionService.class);
queueDAO = Mockito.mock(QueueDAO.class);
Injector injector = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
bind(ExecutionService.class).toInstance(executionService);
bind(QueueDAO.class).toInstance(queueDAO);
install(new ValidationModule());
bindInterceptor(Matchers.any(), Matchers.annotatedWith(Service.class), new ServiceInterceptor(getProvider(Validator.class)));
}
});
taskService = injector.getInstance(TaskServiceImpl.class);
}
use of com.netflix.conductor.interceptors.ServiceInterceptor in project conductor by Netflix.
the class WorkflowServiceTest method before.
@Before
public void before() {
this.mockWorkflowExecutor = Mockito.mock(WorkflowExecutor.class);
this.mockExecutionService = Mockito.mock(ExecutionService.class);
this.mockMetadata = Mockito.mock(MetadataService.class);
Configuration mockConfig = Mockito.mock(Configuration.class);
when(mockConfig.getIntProperty(anyString(), anyInt())).thenReturn(5_000);
this.workflowService = new WorkflowServiceImpl(this.mockWorkflowExecutor, this.mockExecutionService, this.mockMetadata, mockConfig);
Injector injector = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
bind(WorkflowExecutor.class).toInstance(mockWorkflowExecutor);
bind(ExecutionService.class).toInstance(mockExecutionService);
bind(MetadataService.class).toInstance(mockMetadata);
bind(Configuration.class).toInstance(mockConfig);
install(new ValidationModule());
bindInterceptor(Matchers.any(), Matchers.annotatedWith(Service.class), new ServiceInterceptor(getProvider(Validator.class)));
}
});
workflowService = injector.getInstance(WorkflowServiceImpl.class);
}
use of com.netflix.conductor.interceptors.ServiceInterceptor 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);
}
Aggregations