@Test(expected=CloudException.class) public void getSingletonServiceInfoByTypeNoService() { StubCloudConnector stubCloudConnector = CloudTestUtil.getTestCloudConnector(); Cloud testCloud = new Cloud(stubCloudConnector, serviceConnectorCreators); testCloud.getSingletonServiceInfoByType(StubServiceInfo.class); }
@Test(expected=CloudException.class) public void getSingletonServiceInfoByTypeMultipleServices() { StubServiceInfo testServiceInfo1 = new StubServiceInfo("test-id", "test-host", 1000, "test-username", "test-password"); StubServiceInfo testServiceInfo2 = new StubServiceInfo("test-id", "test-host", 1000, "test-username", "test-password"); StubCloudConnector stubCloudConnector = CloudTestUtil.getTestCloudConnector(testServiceInfo1, testServiceInfo2); Cloud testCloud = new Cloud(stubCloudConnector, serviceConnectorCreators); testCloud.getSingletonServiceInfoByType(StubServiceInfo.class); }
@Test public void getSingletonServiceInfoByTypeSingleService() { StubServiceInfo testServiceInfo = new StubServiceInfo("test-id", "test-host", 1000, "test-username", "test-password"); StubCloudConnector stubCloudConnector = CloudTestUtil.getTestCloudConnector(testServiceInfo); Cloud testCloud = new Cloud(stubCloudConnector, serviceConnectorCreators); assertNotNull(testCloud.getSingletonServiceInfoByType(StubServiceInfo.class)); }