Search in sources :

Example 31 with Action

use of com.redhat.service.smartevents.infra.models.gateways.Action in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class WebhookActionInvokerBuilderTest method createProcessor.

private ProcessorDTO createProcessor() {
    Action action = new Action();
    action.setType(WebhookAction.TYPE);
    Map<String, String> params = new HashMap<>();
    params.put(ENDPOINT_PARAM, TEST_ENDPOINT);
    action.setMapParameters(params);
    ProcessorDTO processor = new ProcessorDTO();
    processor.setType(ProcessorType.SINK);
    processor.setId("myProcessor");
    processor.setDefinition(new ProcessorDefinition(null, null, action));
    processor.setBridgeId("myBridge");
    return processor;
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) HashMap(java.util.HashMap) ProcessorDTO(com.redhat.service.smartevents.infra.models.dto.ProcessorDTO) ProcessorDefinition(com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition)

Example 32 with Action

use of com.redhat.service.smartevents.infra.models.gateways.Action in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ExecutorTestUtils method createSourceProcessor.

public static ProcessorDTO createSourceProcessor() {
    Source requestedSource = new Source();
    requestedSource.setType(SlackSource.TYPE);
    Action resolvedAction = new Action();
    resolvedAction.setType(WebhookAction.TYPE);
    return createProcessor(ProcessorType.SOURCE, new ProcessorDefinition(null, null, requestedSource, resolvedAction));
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) KafkaTopicAction(com.redhat.service.smartevents.processor.actions.kafkatopic.KafkaTopicAction) SendToBridgeAction(com.redhat.service.smartevents.processor.actions.sendtobridge.SendToBridgeAction) WebhookAction(com.redhat.service.smartevents.processor.actions.webhook.WebhookAction) ProcessorDefinition(com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition) SlackSource(com.redhat.service.smartevents.processor.sources.slack.SlackSource) Source(com.redhat.service.smartevents.infra.models.gateways.Source)

Example 33 with Action

use of com.redhat.service.smartevents.infra.models.gateways.Action in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ExecutorTestUtils method createSinkProcessorWithSameAction.

public static ProcessorDTO createSinkProcessorWithSameAction() {
    Action action = new Action();
    action.setType(KafkaTopicAction.TYPE);
    return createProcessor(ProcessorType.SINK, new ProcessorDefinition(null, null, action));
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) KafkaTopicAction(com.redhat.service.smartevents.processor.actions.kafkatopic.KafkaTopicAction) SendToBridgeAction(com.redhat.service.smartevents.processor.actions.sendtobridge.SendToBridgeAction) WebhookAction(com.redhat.service.smartevents.processor.actions.webhook.WebhookAction) ProcessorDefinition(com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition)

Example 34 with Action

use of com.redhat.service.smartevents.infra.models.gateways.Action in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ExecutorTestUtils method createSinkProcessorWithResolvedAction.

public static ProcessorDTO createSinkProcessorWithResolvedAction() {
    Action requestedAction = new Action();
    requestedAction.setType(SendToBridgeAction.TYPE);
    Action resolvedAction = new Action();
    resolvedAction.setType(WebhookAction.TYPE);
    return createProcessor(ProcessorType.SINK, new ProcessorDefinition(null, null, requestedAction, resolvedAction));
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) KafkaTopicAction(com.redhat.service.smartevents.processor.actions.kafkatopic.KafkaTopicAction) SendToBridgeAction(com.redhat.service.smartevents.processor.actions.sendtobridge.SendToBridgeAction) WebhookAction(com.redhat.service.smartevents.processor.actions.webhook.WebhookAction) ProcessorDefinition(com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition)

Example 35 with Action

use of com.redhat.service.smartevents.infra.models.gateways.Action in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class TestSupport method newRequestedProcessorDTO.

public static ProcessorDTO newRequestedProcessorDTO() {
    Set<BaseFilter> filters = new HashSet<>();
    filters.add(new StringEquals("key", "value"));
    String transformationTemplate = "{\"test\": {key}}";
    Action a = new Action();
    a.setType(KafkaTopicAction.TYPE);
    Map<String, String> params = new HashMap<>();
    params.put(KafkaTopicAction.TOPIC_PARAM, "myTopic");
    a.setMapParameters(params);
    ProcessorDefinition definition = new ProcessorDefinition(filters, transformationTemplate, a);
    ProcessorDTO dto = new ProcessorDTO();
    dto.setType(PROCESSOR_TYPE);
    dto.setId(PROCESSOR_ID);
    dto.setName(PROCESSOR_NAME);
    dto.setDefinition(definition);
    dto.setBridgeId(BRIDGE_ID);
    dto.setCustomerId(CUSTOMER_ID);
    dto.setOwner(USER_NAME);
    dto.setStatus(PREPARING);
    dto.setKafkaConnection(KAFKA_CONNECTION_DTO);
    return dto;
}
Also used : StringEquals(com.redhat.service.smartevents.infra.models.filters.StringEquals) Action(com.redhat.service.smartevents.infra.models.gateways.Action) KafkaTopicAction(com.redhat.service.smartevents.processor.actions.kafkatopic.KafkaTopicAction) HashMap(java.util.HashMap) ProcessorDTO(com.redhat.service.smartevents.infra.models.dto.ProcessorDTO) ProcessorDefinition(com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition) BaseFilter(com.redhat.service.smartevents.infra.models.filters.BaseFilter) HashSet(java.util.HashSet)

Aggregations

Action (com.redhat.service.smartevents.infra.models.gateways.Action)62 KafkaTopicAction (com.redhat.service.smartevents.processor.actions.kafkatopic.KafkaTopicAction)23 QuarkusTest (io.quarkus.test.junit.QuarkusTest)23 Test (org.junit.jupiter.api.Test)23 WebhookAction (com.redhat.service.smartevents.processor.actions.webhook.WebhookAction)21 SlackAction (com.redhat.service.smartevents.processor.actions.slack.SlackAction)13 HashMap (java.util.HashMap)13 ProcessorDefinition (com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition)12 Processor (com.redhat.service.smartevents.manager.models.Processor)12 SendToBridgeAction (com.redhat.service.smartevents.processor.actions.sendtobridge.SendToBridgeAction)12 ProcessorRequest (com.redhat.service.smartevents.manager.api.models.requests.ProcessorRequest)9 Source (com.redhat.service.smartevents.infra.models.gateways.Source)7 BaseFilter (com.redhat.service.smartevents.infra.models.filters.BaseFilter)6 BridgeResponse (com.redhat.service.smartevents.manager.api.models.responses.BridgeResponse)6 Bridge (com.redhat.service.smartevents.manager.models.Bridge)6 TestSecurity (io.quarkus.test.security.TestSecurity)6 ProcessorResponse (com.redhat.service.smartevents.manager.api.models.responses.ProcessorResponse)5 Response (io.restassured.response.Response)5 ProcessorDTO (com.redhat.service.smartevents.infra.models.dto.ProcessorDTO)4 StringEquals (com.redhat.service.smartevents.infra.models.filters.StringEquals)4