use of org.springframework.cloud.service.BaseServiceInfo in project spring-cloud-connectors by spring-cloud.
the class AbstractCloudConfigServiceScanTest method skipUnknowServices.
@Test
public void skipUnknowServices() {
ApplicationContext testContext = getTestApplicationContext(createMysqlService("mysqlDb"), new BaseServiceInfo("newrelic-service"));
assertNotNull("Getting service by id", testContext.getBean("mysqlDb"));
assertNotNull("Getting service by id and type", testContext.getBean("mysqlDb", DataSource.class));
}
use of org.springframework.cloud.service.BaseServiceInfo in project spring-cloud-connectors by spring-cloud.
the class StubServiceConnectorConfig method getSingletonServiceConnectorNoMatchingServiceConnectorCreator.
@Test(expected = CloudException.class)
public void getSingletonServiceConnectorNoMatchingServiceConnectorCreator() {
// Think an app bound to a (user) service that doesn't have a corresponding
// registered ServiceConnectorCreator. When user asks for singleton service connector
// for another type (with a corresponding creator registered),
// getSingletonServiceConnector() should throw a CloudException.
BaseServiceInfo testServiceInfo = new BaseServiceInfo("user-service");
StubCloudConnector stubCloudConnector = CloudTestUtil.getTestCloudConnector(testServiceInfo);
serviceConnectorCreators.add(new StubServiceConnectorCreator());
Cloud testCloud = new Cloud(stubCloudConnector, serviceConnectorCreators);
testCloud.getSingletonServiceConnector(StubServiceConnector.class, null);
}
Aggregations