Search in sources :

Example 51 with Action

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

the class SendToBridgeActionResolverTest method testActionWithUnknownBridgeId.

@Test
void testActionWithUnknownBridgeId() {
    Action inputAction = actionWithBridgeId(UNKNOWN_BRIDGE_ID);
    assertThatExceptionOfType(ItemNotFoundException.class).isThrownBy(() -> resolver.resolve(inputAction, TEST_CUSTOMER_ID, BRIDGE_ID, ""));
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) WebhookAction(com.redhat.service.smartevents.processor.actions.webhook.WebhookAction) ItemNotFoundException(com.redhat.service.smartevents.infra.exceptions.definitions.user.ItemNotFoundException) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Example 52 with Action

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

the class SendToBridgeActionResolverTest method testActionWithOtherBridgeId.

@Test
void testActionWithOtherBridgeId() {
    Action inputAction = actionWithBridgeId(OTHER_BRIDGE_ID);
    Action resolvedAction = resolver.resolve(inputAction, TEST_CUSTOMER_ID, BRIDGE_ID, "");
    assertValid(resolvedAction, OTHER_BRIDGE_WEBHOOK);
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) WebhookAction(com.redhat.service.smartevents.processor.actions.webhook.WebhookAction) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Example 53 with Action

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

the class SendToBridgeActionResolverTest method testActionWithSameBridgeId.

@Test
void testActionWithSameBridgeId() {
    Action inputAction = actionWithBridgeId(BRIDGE_ID);
    Action resolvedAction = resolver.resolve(inputAction, TEST_CUSTOMER_ID, BRIDGE_ID, "");
    assertValid(resolvedAction, BRIDGE_WEBHOOK);
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) WebhookAction(com.redhat.service.smartevents.processor.actions.webhook.WebhookAction) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Example 54 with Action

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

the class SendToBridgeActionResolverTest method testActionWithoutBridgeId.

@Test
void testActionWithoutBridgeId() {
    Action inputAction = actionWithoutBridgeId();
    Action resolvedAction = resolver.resolve(inputAction, TEST_CUSTOMER_ID, BRIDGE_ID, "");
    assertValid(resolvedAction, BRIDGE_WEBHOOK);
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) WebhookAction(com.redhat.service.smartevents.processor.actions.webhook.WebhookAction) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Example 55 with Action

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

the class SendToBridgeActionValidatorTest method actionWithNullParams.

private Action actionWithNullParams() {
    Action b = new Action();
    b.setType(SendToBridgeAction.TYPE);
    return b;
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action)

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