Search in sources :

Example 46 with ServiceInfo

use of org.springframework.cloud.service.ServiceInfo 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());
}
Also used : ServiceInfo(org.springframework.cloud.service.ServiceInfo) MongoServiceInfo(org.springframework.cloud.service.common.MongoServiceInfo) MongoServiceInfo(org.springframework.cloud.service.common.MongoServiceInfo) Test(org.junit.Test)

Example 47 with ServiceInfo

use of org.springframework.cloud.service.ServiceInfo in project spring-cloud-connectors by spring-cloud.

the class CloudScanHelper method registerServiceBeans.

public void registerServiceBeans(BeanDefinitionRegistry registry) {
    initializeCloud(registry);
    List<ServiceInfo> serviceInfos = cloud.getServiceInfos();
    for (ServiceInfo serviceInfo : serviceInfos) {
        registerServiceBean(registry, serviceInfo);
    }
}
Also used : ServiceInfo(org.springframework.cloud.service.ServiceInfo)

Aggregations

ServiceInfo (org.springframework.cloud.service.ServiceInfo)47 Test (org.junit.Test)37 MysqlServiceInfo (org.springframework.cloud.service.common.MysqlServiceInfo)16 AmqpServiceInfo (org.springframework.cloud.service.common.AmqpServiceInfo)8 HashMap (java.util.HashMap)6 CompositeServiceInfo (org.springframework.cloud.service.CompositeServiceInfo)5 MongoServiceInfo (org.springframework.cloud.service.common.MongoServiceInfo)5 PostgresqlServiceInfo (org.springframework.cloud.service.common.PostgresqlServiceInfo)5 RedisServiceInfo (org.springframework.cloud.service.common.RedisServiceInfo)4 ArrayList (java.util.ArrayList)3 UriBasedServiceInfo (org.springframework.cloud.service.UriBasedServiceInfo)3 DB2ServiceInfo (org.springframework.cloud.service.common.DB2ServiceInfo)3 OracleServiceInfo (org.springframework.cloud.service.common.OracleServiceInfo)3 SqlServerServiceInfo (org.springframework.cloud.service.common.SqlServerServiceInfo)3 StubCloudConnector (org.springframework.cloud.CloudTestUtil.StubCloudConnector)2 StubCompositeServiceInfo (org.springframework.cloud.CloudTestUtil.StubCompositeServiceInfo)2 StubServiceInfo (org.springframework.cloud.CloudTestUtil.StubServiceInfo)2 BaseServiceInfo (org.springframework.cloud.service.BaseServiceInfo)2 RelationalServiceInfo (org.springframework.cloud.service.common.RelationalServiceInfo)2 SmtpServiceInfo (org.springframework.cloud.service.common.SmtpServiceInfo)2