Search in sources :

Example 1 with InvokableActionProvider

use of com.redhat.service.bridge.actions.InvokableActionProvider in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ExecutorTest method setup.

@BeforeEach
void setup() {
    actionProviderFactoryMock = mock(ActionProviderFactory.class);
    actionInvokerMock = mock(ActionInvoker.class);
    InvokableActionProvider actionProvider = mock(InvokableActionProvider.class);
    when(actionProvider.getActionInvoker(any(), any())).thenReturn(actionInvokerMock);
    when(actionProviderFactoryMock.getInvokableActionProvider(KafkaTopicAction.TYPE)).thenReturn(actionProvider);
    when(actionProviderFactoryMock.getInvokableActionProvider(WebhookAction.TYPE)).thenReturn(actionProvider);
    when(actionProviderFactoryMock.getInvokableActionProvider(not(or(eq(KafkaTopicAction.TYPE), eq(WebhookAction.TYPE))))).thenThrow(new ActionProviderException("Unknown action type"));
    meterRegistry = new SimpleMeterRegistry();
}
Also used : ActionInvoker(com.redhat.service.bridge.actions.ActionInvoker) ActionProviderException(com.redhat.service.bridge.infra.exceptions.definitions.user.ActionProviderException) InvokableActionProvider(com.redhat.service.bridge.actions.InvokableActionProvider) SimpleMeterRegistry(io.micrometer.core.instrument.simple.SimpleMeterRegistry) ActionProviderFactory(com.redhat.service.bridge.actions.ActionProviderFactory) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ActionInvoker (com.redhat.service.bridge.actions.ActionInvoker)1 ActionProviderFactory (com.redhat.service.bridge.actions.ActionProviderFactory)1 InvokableActionProvider (com.redhat.service.bridge.actions.InvokableActionProvider)1 ActionProviderException (com.redhat.service.bridge.infra.exceptions.definitions.user.ActionProviderException)1 SimpleMeterRegistry (io.micrometer.core.instrument.simple.SimpleMeterRegistry)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1