Search in sources :

Example 21 with BridgeRequest

use of com.redhat.service.smartevents.manager.api.models.requests.BridgeRequest in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class BridgesAPITest method testAlreadyExistingBridge.

@Test
@TestSecurity(user = DEFAULT_CUSTOMER_ID)
public void testAlreadyExistingBridge() {
    TestUtils.createBridge(new BridgeRequest(DEFAULT_BRIDGE_NAME)).then().statusCode(202);
    TestUtils.createBridge(new BridgeRequest(DEFAULT_BRIDGE_NAME)).then().statusCode(400);
}
Also used : BridgeRequest(com.redhat.service.smartevents.manager.api.models.requests.BridgeRequest) TestSecurity(io.quarkus.test.security.TestSecurity) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Example 22 with BridgeRequest

use of com.redhat.service.smartevents.manager.api.models.requests.BridgeRequest in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class BridgesAPITest method getBridge.

@Test
@TestSecurity(user = DEFAULT_CUSTOMER_ID)
public void getBridge() {
    Response bridgeCreateResponse = TestUtils.createBridge(new BridgeRequest(DEFAULT_BRIDGE_NAME));
    bridgeCreateResponse.then().statusCode(202);
    BridgeResponse bridge = bridgeCreateResponse.as(BridgeResponse.class);
    BridgeResponse retrievedBridge = TestUtils.getBridge(bridge.getId()).as(BridgeResponse.class);
    assertThat(retrievedBridge).isNotNull();
    assertThat(retrievedBridge.getId()).isEqualTo(bridge.getId());
    assertThat(retrievedBridge.getName()).isEqualTo(bridge.getName());
    assertThat(retrievedBridge.getEndpoint()).isEqualTo(bridge.getEndpoint());
}
Also used : ErrorResponse(com.redhat.service.smartevents.infra.api.models.responses.ErrorResponse) BridgeResponse(com.redhat.service.smartevents.manager.api.models.responses.BridgeResponse) BridgeListResponse(com.redhat.service.smartevents.manager.api.models.responses.BridgeListResponse) Response(io.restassured.response.Response) BridgeRequest(com.redhat.service.smartevents.manager.api.models.requests.BridgeRequest) BridgeResponse(com.redhat.service.smartevents.manager.api.models.responses.BridgeResponse) TestSecurity(io.quarkus.test.security.TestSecurity) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Aggregations

BridgeRequest (com.redhat.service.smartevents.manager.api.models.requests.BridgeRequest)22 QuarkusTest (io.quarkus.test.junit.QuarkusTest)21 Test (org.junit.jupiter.api.Test)21 TestSecurity (io.quarkus.test.security.TestSecurity)14 BridgeResponse (com.redhat.service.smartevents.manager.api.models.responses.BridgeResponse)13 BridgeDTO (com.redhat.service.smartevents.infra.models.dto.BridgeDTO)10 TypeRef (io.restassured.common.mapper.TypeRef)9 ArrayList (java.util.ArrayList)9 KafkaConnectionDTO (com.redhat.service.smartevents.infra.models.dto.KafkaConnectionDTO)8 ProcessorRequest (com.redhat.service.smartevents.manager.api.models.requests.ProcessorRequest)8 ProcessorDTO (com.redhat.service.smartevents.infra.models.dto.ProcessorDTO)7 Bridge (com.redhat.service.smartevents.manager.models.Bridge)7 BaseFilter (com.redhat.service.smartevents.infra.models.filters.BaseFilter)5 StringEquals (com.redhat.service.smartevents.infra.models.filters.StringEquals)5 Action (com.redhat.service.smartevents.infra.models.gateways.Action)5 KafkaTopicAction (com.redhat.service.smartevents.processor.actions.kafkatopic.KafkaTopicAction)4 SendToBridgeAction (com.redhat.service.smartevents.processor.actions.sendtobridge.SendToBridgeAction)4 WebhookAction (com.redhat.service.smartevents.processor.actions.webhook.WebhookAction)4 ACCOUNT_ID_SERVICE_ACCOUNT_ATTRIBUTE_CLAIM (com.redhat.service.smartevents.infra.api.APIConstants.ACCOUNT_ID_SERVICE_ACCOUNT_ATTRIBUTE_CLAIM)3 ORG_ID_SERVICE_ACCOUNT_ATTRIBUTE_CLAIM (com.redhat.service.smartevents.infra.api.APIConstants.ORG_ID_SERVICE_ACCOUNT_ATTRIBUTE_CLAIM)3