use of com.redhat.service.bridge.infra.models.actions.BaseAction in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ConnectorsServiceTest method testKafkaAction.
private BaseAction testKafkaAction() {
BaseAction action = new BaseAction();
action.setType(KafkaTopicAction.TYPE);
action.setParameters(Map.of(SlackAction.CHANNEL_PARAMETER, TEST_ACTION_CHANNEL, SlackAction.WEBHOOK_URL_PARAMETER, TEST_ACTION_WEBHOOK, KafkaTopicAction.TOPIC_PARAM, testActionTopic()));
return action;
}
use of com.redhat.service.bridge.infra.models.actions.BaseAction in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ConnectorsDAOTest method createProcessor.
private Processor createProcessor(Bridge bridge, String name) {
Processor p = new Processor();
p.setBridge(bridge);
p.setName(name);
p.setStatus(ManagedResourceStatus.ACCEPTED);
p.setSubmittedAt(ZonedDateTime.now());
p.setPublishedAt(ZonedDateTime.now());
BaseAction a = new BaseAction();
a.setType(KafkaTopicAction.TYPE);
Map<String, String> params = new HashMap<>();
params.put(KafkaTopicAction.TOPIC_PARAM, TestConstants.DEFAULT_KAFKA_TOPIC);
a.setParameters(params);
ProcessorDefinition definition = new ProcessorDefinition(Collections.emptySet(), null, a);
p.setDefinition(mapper.valueToTree(definition));
processorDAO.persist(p);
return p;
}
use of com.redhat.service.bridge.infra.models.actions.BaseAction in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class TestUtils method createSendToBridgeAction.
public static BaseAction createSendToBridgeAction(String bridgeId) {
BaseAction r = new BaseAction();
r.setType(SendToBridgeAction.TYPE);
Map<String, String> params = new HashMap<>();
params.put(SendToBridgeAction.BRIDGE_ID_PARAM, bridgeId);
r.setParameters(params);
return r;
}
use of com.redhat.service.bridge.infra.models.actions.BaseAction in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ActionParamValidatorContainerTest method buildTestRequest.
private ProcessorRequest buildTestRequest() {
ProcessorRequest p = new ProcessorRequest();
BaseAction b = new BaseAction();
b.setType(TEST_ACTION_TYPE);
Map<String, String> params = new HashMap<>();
params.put(TEST_PARAM_NAME, TEST_PARAM_VALUE);
b.setParameters(params);
p.setAction(b);
return p;
}
use of com.redhat.service.bridge.infra.models.actions.BaseAction in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class SendToBridgeActionTransformerTest method testActionWithUnavailableBridgeId.
@Test
void testActionWithUnavailableBridgeId() {
BaseAction inputAction = actionWithBridgeId(UNAVAILABLE_BRIDGE_ID);
ProcessorRequest inputRequest = requestWithAction(inputAction);
assertThatExceptionOfType(BridgeLifecycleException.class).isThrownBy(() -> transformer.transform(inputRequest.getAction(), bridge.getId(), TEST_CUSTOMER_ID, ""));
}
Aggregations