use of com.redhat.service.bridge.manager.models.Bridge in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorDAOTest method findByBridgeIdAndName_noMatchingProcessorName.
@Test
public void findByBridgeIdAndName_noMatchingProcessorName() {
Bridge b = createBridge();
createProcessor(b, "foo");
assertThat(processorDAO.findByBridgeIdAndName(b.getId(), "doesNotExist")).isNull();
}
use of com.redhat.service.bridge.manager.models.Bridge in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ProcessorDAOTest method findByIdBridgeIdAndCustomerId_doesNotExist.
@Test
public void findByIdBridgeIdAndCustomerId_doesNotExist() {
Bridge b = createBridge();
createProcessor(b, "foo");
Processor found = processorDAO.findByIdBridgeIdAndCustomerId("doesntExist", b.getId(), b.getCustomerId());
assertThat(found).isNull();
}
use of com.redhat.service.bridge.manager.models.Bridge in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgesServiceTest method testUpdateBridgeStatus.
@Test
public void testUpdateBridgeStatus() {
BridgeRequest request = new BridgeRequest(TestConstants.DEFAULT_BRIDGE_NAME);
Bridge bridge = bridgesService.createBridge(TestConstants.DEFAULT_CUSTOMER_ID, request);
List<Bridge> bridges = bridgesService.getBridgesByStatusesAndShardId(Collections.singletonList(ManagedResourceStatus.ACCEPTED), TestConstants.SHARD_ID);
assertThat(bridges.size()).isEqualTo(1);
assertThat(bridges.get(0).getStatus()).isEqualTo(ManagedResourceStatus.ACCEPTED);
bridge.setStatus(ManagedResourceStatus.PROVISIONING);
bridgesService.updateBridge(bridgesService.toDTO(bridge));
bridges = bridgesService.getBridgesByStatusesAndShardId(Collections.singletonList(ManagedResourceStatus.ACCEPTED), TestConstants.SHARD_ID);
assertThat(bridges.size()).isZero();
Bridge retrievedBridge = bridgesService.getBridge(bridge.getId(), TestConstants.DEFAULT_CUSTOMER_ID);
assertThat(retrievedBridge.getStatus()).isEqualTo(ManagedResourceStatus.PROVISIONING);
}
use of com.redhat.service.bridge.manager.models.Bridge in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgesServiceTest method testGetEmptyBridges.
@Test
public void testGetEmptyBridges() {
ListResult<Bridge> bridges = bridgesService.getBridges(TestConstants.DEFAULT_CUSTOMER_ID, new QueryInfo(TestConstants.DEFAULT_PAGE, TestConstants.DEFAULT_PAGE_SIZE));
assertThat(bridges.getPage()).isZero();
assertThat(bridges.getTotal()).isZero();
assertThat(bridges.getSize()).isZero();
}
use of com.redhat.service.bridge.manager.models.Bridge in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class BridgesServiceTest method testGetBridgeWithWrongCustomerId.
@Test
public void testGetBridgeWithWrongCustomerId() {
BridgeRequest request = new BridgeRequest(TestConstants.DEFAULT_BRIDGE_NAME);
Bridge bridge = bridgesService.createBridge(TestConstants.DEFAULT_CUSTOMER_ID, request);
assertThatExceptionOfType(ItemNotFoundException.class).isThrownBy(() -> bridgesService.getBridge(bridge.getId(), "not-the-customerId"));
}
Aggregations