use of com.redhat.service.smartevents.manager.api.models.responses.BridgeListResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgesAPITest method testGetBridgesFilterByName.
@Test
@TestSecurity(user = DEFAULT_CUSTOMER_ID)
public void testGetBridgesFilterByName() {
Bridge bridge1 = Fixtures.createBridge();
bridge1.setName(DEFAULT_BRIDGE_NAME + "1");
bridge1.setStatus(ACCEPTED);
bridgeDAO.persist(bridge1);
Bridge bridge2 = Fixtures.createBridge();
bridge2.setName(DEFAULT_BRIDGE_NAME + "2");
bridge2.setStatus(ACCEPTED);
bridgeDAO.persist(bridge2);
BridgeListResponse bridgeListResponse = TestUtils.getBridgesFilterByName(DEFAULT_BRIDGE_NAME + "1").as(BridgeListResponse.class);
assertThat(bridgeListResponse.getItems().size()).isEqualTo(1);
BridgeResponse bridgeResponse = bridgeListResponse.getItems().get(0);
assertThat(bridgeResponse.getName()).isEqualTo(bridge1.getName());
assertThat(bridgeResponse.getStatus()).isEqualTo(bridge1.getStatus());
assertThat(bridgeResponse.getHref()).isEqualTo(USER_API_BASE_PATH + bridgeResponse.getId());
assertThat(bridgeResponse.getSubmittedAt()).isNotNull();
assertThat(bridgeResponse.getEndpoint()).isNotNull();
}
use of com.redhat.service.smartevents.manager.api.models.responses.BridgeListResponse in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgesAPITest method testGetBridgesFilterByStatus.
@Test
@TestSecurity(user = DEFAULT_CUSTOMER_ID)
public void testGetBridgesFilterByStatus() {
Bridge bridge1 = Fixtures.createBridge();
bridge1.setName(DEFAULT_BRIDGE_NAME + "1");
bridge1.setStatus(READY);
bridgeDAO.persist(bridge1);
Bridge bridge2 = Fixtures.createBridge();
bridge2.setName(DEFAULT_BRIDGE_NAME + "2");
bridge2.setStatus(ACCEPTED);
bridgeDAO.persist(bridge2);
BridgeListResponse bridgeListResponse = TestUtils.getBridgesFilterByStatus(ACCEPTED).as(BridgeListResponse.class);
assertThat(bridgeListResponse.getItems().size()).isEqualTo(1);
BridgeResponse bridgeResponse = bridgeListResponse.getItems().get(0);
assertThat(bridgeResponse.getName()).isEqualTo(bridge2.getName());
assertThat(bridgeResponse.getStatus()).isEqualTo(bridge2.getStatus());
assertThat(bridgeResponse.getHref()).isEqualTo(USER_API_BASE_PATH + bridgeResponse.getId());
assertThat(bridgeResponse.getSubmittedAt()).isNotNull();
assertThat(bridgeResponse.getEndpoint()).isNotNull();
}
Aggregations