use of com.redhat.service.smartevents.infra.models.gateways.Action in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class SendToBridgeActionResolverTest method testActionWithUnavailableBridgeId.
@Test
void testActionWithUnavailableBridgeId() {
Action inputAction = actionWithBridgeId(UNAVAILABLE_BRIDGE_ID);
assertThatExceptionOfType(BridgeLifecycleException.class).isThrownBy(() -> resolver.resolve(inputAction, TEST_CUSTOMER_ID, BRIDGE_ID, ""));
}
use of com.redhat.service.smartevents.infra.models.gateways.Action in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class SlackActionResolverTest method testTransform.
@Test
void testTransform() {
Action action = buildTestAction();
Action transformedAction = slackActionResolver.resolve(action, TEST_CUSTOMER_ID, TEST_BRIDGE_ID, TEST_PROCESSOR_ID);
assertThat(transformedAction.getType()).isEqualTo(KafkaTopicAction.TYPE);
assertThat(transformedAction.getParameter(SlackAction.CHANNEL_PARAM)).isEqualTo(TEST_CHANNEL_PARAM);
assertThat(transformedAction.getParameter(SlackAction.WEBHOOK_URL_PARAM)).isEqualTo(TEST_WEBHOOK_PARAM);
assertThat(transformedAction.getParameter(KafkaTopicAction.TOPIC_PARAM)).isEqualTo(TEST_PROCESSOR_TOPIC_NAME);
}
use of com.redhat.service.smartevents.infra.models.gateways.Action in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class SlackActionResolverTest method buildTestAction.
private Action buildTestAction() {
Map<String, String> parameters = Map.of(SlackAction.CHANNEL_PARAM, TEST_CHANNEL_PARAM, SlackAction.WEBHOOK_URL_PARAM, TEST_WEBHOOK_PARAM);
Action action = new Action();
action.setType(SlackAction.TYPE);
action.setMapParameters(parameters);
return action;
}
use of com.redhat.service.smartevents.infra.models.gateways.Action in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class WebhookActionValidatorTest method isInvalidWithNullParametersMap.
@Test
void isInvalidWithNullParametersMap() {
Action action = new Action();
action.setType(WebhookAction.TYPE);
action.setMapParameters(new HashMap<>());
ValidationResult validationResult = validator.isValid(action);
assertThat(validationResult.isValid()).isFalse();
}
use of com.redhat.service.smartevents.infra.models.gateways.Action in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class KafkaTopicActionInvokerBuilderTest method createProcessorWithActionForTopic.
private ProcessorDTO createProcessorWithActionForTopic(String topicName) {
Action b = new Action();
b.setType(KafkaTopicAction.TYPE);
Map<String, String> params = new HashMap<>();
params.put(KafkaTopicAction.TOPIC_PARAM, topicName);
b.setMapParameters(params);
ProcessorDTO p = new ProcessorDTO();
p.setType(ProcessorType.SINK);
p.setId("myProcessor");
p.setDefinition(new ProcessorDefinition(null, null, b));
p.setBridgeId("myBridge");
return p;
}
Aggregations