Merge pull request #172 from jwoodrich/master
Oracle ServiceInfoCreator for localconfig
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user