use of org.springframework.cloud.service.common.MongoServiceInfo in project spring-cloud-connectors by spring-cloud.
the class CloudTest method servicePropsMongoMultipleHostsUriString.
@Test
public void servicePropsMongoMultipleHostsUriString() {
String serviceId = "my-mongo-multiple-hosts-uri";
MongoServiceInfo mongoServiceInfo = createMongoServiceWithMultipleHostsByUri(serviceId);
CloudConnector stubCloudConnector = getTestCloudConnector(mongoServiceInfo);
Cloud testCloud = new Cloud(stubCloudConnector, serviceCreators);
Properties cloudProperties = testCloud.getCloudProperties();
assertMongoPropsWithMultipleHostsByUri("cloud.services.my-mongo-multiple-hosts-uri", mongoServiceInfo, cloudProperties);
assertMongoPropsWithMultipleHostsByUri("cloud.services.mongo", mongoServiceInfo, cloudProperties);
}
use of org.springframework.cloud.service.common.MongoServiceInfo in project spring-cloud-connectors by spring-cloud.
the class LocalConfigServiceOverrideTest method serviceOverride.
@Test
public void serviceOverride() {
env.setSystemProperty("spring.cloud.candygram", "mongodb://youruser:yourpass@40.30.20.10:4321/dbname");
List<ServiceInfo> services = connector.getServiceInfos();
ServiceInfo service = getServiceInfo(services, "candygram");
assertNotNull(service);
assertTrue(service instanceof MongoServiceInfo);
MongoServiceInfo mongo = (MongoServiceInfo) service;
assertEquals("youruser", mongo.getUserName());
assertEquals(4321, mongo.getPort());
}
use of org.springframework.cloud.service.common.MongoServiceInfo in project spring-cloud-connectors by spring-cloud.
the class LocalConfigConnectorMongoServiceTest method serviceCreation.
@Test
public void serviceCreation() {
List<ServiceInfo> services = connector.getServiceInfos();
ServiceInfo service = getServiceInfo(services, "candygram");
assertNotNull(service);
assertTrue(service instanceof MongoServiceInfo);
assertUriParameters((MongoServiceInfo) service);
}
Aggregations