Merge pull request #172 from jwoodrich/master

Oracle ServiceInfoCreator for localconfig
This commit is contained in:
Scott Frederick
2017-04-05 11:24:23 -05:00
committed by GitHub
4 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
package org.springframework.cloud.localconfig;
import org.springframework.cloud.service.common.OracleServiceInfo;
/**
* Oracle ServiceInfo creator for localconfig connector.
* @author Jason Woodrich
*/
public class OracleServiceInfoCreator extends LocalConfigServiceInfoCreator<OracleServiceInfo> {
public OracleServiceInfoCreator() {
super(OracleServiceInfo.ORACLE_SCHEME);
}
@Override
public OracleServiceInfo createServiceInfo(String id, String uri) {
return new OracleServiceInfo(id,uri);
}
}

View File

@@ -1,5 +1,6 @@
org.springframework.cloud.localconfig.AmqpServiceInfoCreator
org.springframework.cloud.localconfig.MongoServiceInfoCreator
org.springframework.cloud.localconfig.MysqlServiceInfoCreator
org.springframework.cloud.localconfig.OracleServiceInfoCreator
org.springframework.cloud.localconfig.PostgresqlServiceInfoCreator
org.springframework.cloud.localconfig.RedisServiceInfoCreator

View File

@@ -0,0 +1,22 @@
package org.springframework.cloud.localconfig;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.List;
import org.junit.Test;
import org.springframework.cloud.service.ServiceInfo;
import org.springframework.cloud.service.common.OracleServiceInfo;
public class LocalConfigConnectorOracleServiceTest extends AbstractLocalConfigConnectorWithUrisTest {
@Test
public void serviceCreation() {
List<ServiceInfo> services = connector.getServiceInfos();
ServiceInfo service = getServiceInfo(services, "oracle");
assertNotNull(service);
assertTrue(service instanceof OracleServiceInfo);
assertUriParameters((OracleServiceInfo) service);
}
}

View File

@@ -3,4 +3,5 @@ spring.cloud.rabbit: amqp://myuser:mypass@10.20.30.40:1234/queue
spring.cloud.maria: mysql://myuser:mypass@10.20.30.40:1234/dbname
spring.cloud.candygram: mongodb://myuser:mypass@10.20.30.40:1234/dbname
spring.cloud.ingres: postgres://myuser:mypass@10.20.30.40:1234/dbname
spring.cloud.oracle: oracle://myuser:mypass@10.20.30.40:1234/dbname
spring.cloud.blue: redis://myuser:mypass@10.20.30.40:1234/dbname