Search in sources :

Example 21 with BridgeRequest

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

the class BridgesServiceTest method testGetBridges.

@Test
public void testGetBridges() {
    BridgeRequest request = new BridgeRequest(TestConstants.DEFAULT_BRIDGE_NAME);
    bridgesService.createBridge(TestConstants.DEFAULT_CUSTOMER_ID, request);
    ListResult<Bridge> bridges = bridgesService.getBridges(TestConstants.DEFAULT_CUSTOMER_ID, new QueryInfo(TestConstants.DEFAULT_PAGE, TestConstants.DEFAULT_PAGE_SIZE));
    assertThat(bridges.getSize()).isEqualTo(1);
    assertThat(bridges.getTotal()).isEqualTo(1);
    assertThat(bridges.getPage()).isZero();
    // filter by customer id not implemented yet
    bridges = bridgesService.getBridges("not-the-id", new QueryInfo(TestConstants.DEFAULT_PAGE, TestConstants.DEFAULT_PAGE_SIZE));
    assertThat(bridges.getSize()).isZero();
    assertThat(bridges.getTotal()).isZero();
    assertThat(bridges.getPage()).isZero();
}
Also used : BridgeRequest(com.redhat.service.bridge.manager.api.models.requests.BridgeRequest) QueryInfo(com.redhat.service.bridge.infra.models.QueryInfo) Bridge(com.redhat.service.bridge.manager.models.Bridge) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Example 22 with BridgeRequest

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

the class BridgesServiceTest method testCreateBridge.

@Test
public void testCreateBridge() {
    BridgeRequest request = new BridgeRequest(TestConstants.DEFAULT_BRIDGE_NAME);
    bridgesService.createBridge(TestConstants.DEFAULT_CUSTOMER_ID, request);
    List<Bridge> bridgesToDeploy = bridgesService.getBridgesByStatusesAndShardId(Collections.singletonList(ManagedResourceStatus.ACCEPTED), TestConstants.SHARD_ID);
    assertThat(bridgesToDeploy.size()).isEqualTo(1);
    assertThat(bridgesToDeploy.get(0).getStatus()).isEqualTo(ManagedResourceStatus.ACCEPTED);
    assertThat(bridgesToDeploy.get(0).getEndpoint()).isNull();
    ListResult<Bridge> bridges = bridgesService.getBridges(TestConstants.DEFAULT_CUSTOMER_ID, new QueryInfo(TestConstants.DEFAULT_PAGE, TestConstants.DEFAULT_PAGE_SIZE));
    assertThat(bridges.getSize()).isEqualTo(1);
}
Also used : BridgeRequest(com.redhat.service.bridge.manager.api.models.requests.BridgeRequest) QueryInfo(com.redhat.service.bridge.infra.models.QueryInfo) Bridge(com.redhat.service.bridge.manager.models.Bridge) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Aggregations

BridgeRequest (com.redhat.service.bridge.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.bridge.manager.api.models.responses.BridgeResponse)13 BridgeDTO (com.redhat.service.bridge.infra.models.dto.BridgeDTO)10 List (java.util.List)9 KafkaConnectionDTO (com.redhat.service.bridge.infra.models.dto.KafkaConnectionDTO)8 ProcessorRequest (com.redhat.service.bridge.manager.api.models.requests.ProcessorRequest)8 ProcessorDTO (com.redhat.service.bridge.infra.models.dto.ProcessorDTO)7 Bridge (com.redhat.service.bridge.manager.models.Bridge)7 BaseFilter (com.redhat.service.bridge.infra.models.filters.BaseFilter)5 StringEquals (com.redhat.service.bridge.infra.models.filters.StringEquals)5 BaseAction (com.redhat.service.bridge.infra.models.actions.BaseAction)4 TypeRef (io.restassured.common.mapper.TypeRef)4 ResponseLoggingFilter (io.restassured.filter.log.ResponseLoggingFilter)4 KafkaTopicAction (com.redhat.service.bridge.actions.kafkatopic.KafkaTopicAction)3 WebhookAction (com.redhat.service.bridge.actions.webhook.WebhookAction)3 APIConstants (com.redhat.service.bridge.infra.api.APIConstants)3 ManagedResourceStatus (com.redhat.service.bridge.infra.models.dto.ManagedResourceStatus)3