Search in sources :

Example 1 with ActionInvokerBuilder

use of com.redhat.service.smartevents.processor.actions.ActionInvokerBuilder in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ExecutorImplTest method setup.

@BeforeEach
void setup() {
    actionInvokerMock = mock(ActionInvoker.class);
    ActionInvokerBuilder actionInvokerBuilder = mock(ActionInvokerBuilder.class);
    when(actionInvokerBuilder.build(any(), any())).thenReturn(actionInvokerMock);
    actionRuntime = mock(ActionRuntime.class);
    when(actionRuntime.getInvokerBuilder(KafkaTopicAction.TYPE)).thenReturn(actionInvokerBuilder);
    when(actionRuntime.getInvokerBuilder(WebhookAction.TYPE)).thenReturn(actionInvokerBuilder);
    when(actionRuntime.getInvokerBuilder(not(or(eq(KafkaTopicAction.TYPE), eq(WebhookAction.TYPE))))).thenThrow(new GatewayProviderException("Unknown action type"));
    meterRegistry = new SimpleMeterRegistry();
}
Also used : ActionInvoker(com.redhat.service.smartevents.processor.actions.ActionInvoker) ActionInvokerBuilder(com.redhat.service.smartevents.processor.actions.ActionInvokerBuilder) SimpleMeterRegistry(io.micrometer.core.instrument.simple.SimpleMeterRegistry) GatewayProviderException(com.redhat.service.smartevents.infra.exceptions.definitions.user.GatewayProviderException) ActionRuntime(com.redhat.service.smartevents.processor.actions.ActionRuntime) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

GatewayProviderException (com.redhat.service.smartevents.infra.exceptions.definitions.user.GatewayProviderException)1 ActionInvoker (com.redhat.service.smartevents.processor.actions.ActionInvoker)1 ActionInvokerBuilder (com.redhat.service.smartevents.processor.actions.ActionInvokerBuilder)1 ActionRuntime (com.redhat.service.smartevents.processor.actions.ActionRuntime)1 SimpleMeterRegistry (io.micrometer.core.instrument.simple.SimpleMeterRegistry)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1