use of org.springframework.cloud.service.common.MysqlServiceInfo in project spring-cloud-connectors by spring-cloud.
the class CloudTest method servicePropsTwoServicesOfTheSameLabel.
@Test
public void servicePropsTwoServicesOfTheSameLabel() {
MysqlServiceInfo mysqlServiceInfo1 = createMysqlService("my-mysql1");
MysqlServiceInfo mysqlServiceInfo2 = createMysqlService("my-mysql2");
CloudConnector stubCloudConnector = getTestCloudConnector(mysqlServiceInfo1, mysqlServiceInfo2);
Cloud testCloud = new Cloud(stubCloudConnector, serviceCreators);
Properties cloudProperties = testCloud.getCloudProperties();
assertRelationalProps("cloud.services.my-mysql1", mysqlServiceInfo1, cloudProperties);
assertRelationalProps("cloud.services.my-mysql2", mysqlServiceInfo2, cloudProperties);
assertNull(cloudProperties.get("cloud.services.mysql.connection.host"));
}
use of org.springframework.cloud.service.common.MysqlServiceInfo in project spring-cloud-connectors by spring-cloud.
the class CloudTest method servicePropsOneServiceOfTheSameLabel.
@Test
public void servicePropsOneServiceOfTheSameLabel() {
MysqlServiceInfo mysqlServiceInfo = createMysqlService("my-mysql");
MongoServiceInfo mongoServiceInfo = createMongoService("my-mongo");
CloudConnector stubCloudConnector = getTestCloudConnector(mysqlServiceInfo, mongoServiceInfo);
Cloud testCloud = new Cloud(stubCloudConnector, serviceCreators);
Properties cloudProperties = testCloud.getCloudProperties();
assertRelationalProps("cloud.services.my-mysql", mysqlServiceInfo, cloudProperties);
assertMongoProps("cloud.services.my-mongo", mongoServiceInfo, cloudProperties);
assertRelationalProps("cloud.services.mysql", mysqlServiceInfo, cloudProperties);
assertMongoProps("cloud.services.mongo", mongoServiceInfo, cloudProperties);
}
use of org.springframework.cloud.service.common.MysqlServiceInfo in project spring-cloud-connectors by spring-cloud.
the class LocalConfigConnectorMysqlServiceTest method serviceCreation.
@Test
public void serviceCreation() {
List<ServiceInfo> services = connector.getServiceInfos();
ServiceInfo service = getServiceInfo(services, "maria");
assertNotNull(service);
assertTrue(service instanceof MysqlServiceInfo);
assertUriParameters((MysqlServiceInfo) service);
}
use of org.springframework.cloud.service.common.MysqlServiceInfo in project spring-cloud-connectors by spring-cloud.
the class HerokuConnectorMysqlServiceTest method mysqlServiceCreation.
@Test
public void mysqlServiceCreation() {
Map<String, String> env = new HashMap<String, String>();
String mysqlUrl = getRelationalServiceUrl("db");
env.put("CLEARDB_DATABASE_URL", mysqlUrl);
when(mockEnvironment.getEnv()).thenReturn(env);
List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();
ServiceInfo serviceInfo = getServiceInfo(serviceInfos, "CLEARDB_DATABASE");
assertNotNull(serviceInfo);
assertTrue(serviceInfo instanceof MysqlServiceInfo);
assertReleationServiceInfo((MysqlServiceInfo) serviceInfo, "db");
}
Aggregations