Search in sources :

Example 11 with QueryResourceInfo

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

the class BridgesServiceTest method testGetBridges.

@Test
public void testGetBridges() {
    BridgeRequest request = new BridgeRequest(DEFAULT_BRIDGE_NAME);
    bridgesService.createBridge(DEFAULT_CUSTOMER_ID, DEFAULT_ORGANISATION_ID, DEFAULT_USER_NAME, request);
    ListResult<Bridge> bridges = bridgesService.getBridges(DEFAULT_CUSTOMER_ID, new QueryResourceInfo(DEFAULT_PAGE, 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 QueryResourceInfo(DEFAULT_PAGE, DEFAULT_PAGE_SIZE));
    assertThat(bridges.getSize()).isZero();
    assertThat(bridges.getTotal()).isZero();
    assertThat(bridges.getPage()).isZero();
}
Also used : BridgeRequest(com.redhat.service.smartevents.manager.api.models.requests.BridgeRequest) QueryResourceInfo(com.redhat.service.smartevents.infra.models.QueryResourceInfo) Bridge(com.redhat.service.smartevents.manager.models.Bridge) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Aggregations

QueryResourceInfo (com.redhat.service.smartevents.infra.models.QueryResourceInfo)11 Bridge (com.redhat.service.smartevents.manager.models.Bridge)11 QuarkusTest (io.quarkus.test.junit.QuarkusTest)11 Test (org.junit.jupiter.api.Test)11 BridgeRequest (com.redhat.service.smartevents.manager.api.models.requests.BridgeRequest)2