use of com.redhat.service.smartevents.processor.actions.ActionInvoker in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class WebhookActionInvokerBuilderTest method testInvokerWithBasicAuth.
@Test
void testInvokerWithBasicAuth() {
ProcessorDTO processor = createProcessor();
processor.getDefinition().getResolvedAction().getParameters().put(BASIC_AUTH_USERNAME_PARAM, TEST_USERNAME);
processor.getDefinition().getResolvedAction().getParameters().put(BASIC_AUTH_PASSWORD_PARAM, TEST_PASSWORD);
ActionInvoker actionInvoker = builder.build(processor, processor.getDefinition().getResolvedAction());
assertThat(actionInvoker).isNotNull().isInstanceOf(WebhookActionInvoker.class);
WebhookActionInvoker webhookActionInvoker = (WebhookActionInvoker) actionInvoker;
assertThat(webhookActionInvoker.getEndpoint()).isEqualTo(TEST_ENDPOINT);
assertThat(webhookActionInvoker.getWebClient()).isNotNull();
assertThat(webhookActionInvoker.getOidcClient()).isNull();
assertThat(webhookActionInvoker.getBasicAuthUsername()).isEqualTo(TEST_USERNAME);
assertThat(webhookActionInvoker.getBasicAuthPassword()).isEqualTo(TEST_PASSWORD);
}
use of com.redhat.service.smartevents.processor.actions.ActionInvoker in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class WebhookActionInvokerBuilderTest method testInvokerWithSslVerificationDisabled.
@Test
void testInvokerWithSslVerificationDisabled() {
ProcessorDTO processor = createProcessor();
processor.getDefinition().getResolvedAction().getParameters().put(SSL_VERIFICATION_DISABLED, "true");
ActionInvoker actionInvoker = builder.build(processor, processor.getDefinition().getResolvedAction());
assertThat(actionInvoker).isNotNull().isInstanceOf(WebhookActionInvoker.class);
WebhookActionInvoker webhookActionInvoker = (WebhookActionInvoker) actionInvoker;
assertThat(webhookActionInvoker.getEndpoint()).isEqualTo(TEST_ENDPOINT);
assertThat(webhookActionInvoker.getWebClient()).isNotNull();
assertThat(webhookActionInvoker.getOidcClient()).isNull();
assertThat(webhookActionInvoker.getBasicAuthUsername()).isNull();
assertThat(webhookActionInvoker.getBasicAuthPassword()).isNull();
}
use of com.redhat.service.smartevents.processor.actions.ActionInvoker in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class WebhookActionInvokerBuilderTest method testInvoker.
@Test
void testInvoker() {
ProcessorDTO processor = createProcessor();
ActionInvoker actionInvoker = builder.build(processor, processor.getDefinition().getResolvedAction());
assertThat(actionInvoker).isNotNull().isInstanceOf(WebhookActionInvoker.class);
WebhookActionInvoker webhookActionInvoker = (WebhookActionInvoker) actionInvoker;
assertThat(webhookActionInvoker.getEndpoint()).isEqualTo(TEST_ENDPOINT);
assertThat(webhookActionInvoker.getWebClient()).isNotNull();
assertThat(webhookActionInvoker.getOidcClient()).isNull();
assertThat(webhookActionInvoker.getBasicAuthUsername()).isNull();
assertThat(webhookActionInvoker.getBasicAuthPassword()).isNull();
}
use of com.redhat.service.smartevents.processor.actions.ActionInvoker in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class KafkaTopicActionInvokerBuilderTest method getActionInvoker.
@Test
void getActionInvoker() {
ProcessorDTO p = createProcessorWithActionForTopic(TOPIC_NAME);
ActionInvoker actionInvoker = builder.build(p, p.getDefinition().getResolvedAction());
assertThat(actionInvoker).isNotNull();
verify(kafkaAdmin).listTopics();
}
Aggregations