Polish SQL Server support and fix unit tests.
This commit is contained in:
@@ -2,15 +2,14 @@ package org.springframework.cloud.cloudfoundry;
|
||||
|
||||
import org.springframework.cloud.service.common.SqlServerServiceInfo;
|
||||
|
||||
public class SqlServerServiceInfoCreator extends
|
||||
RelationalServiceInfoCreator<SqlServerServiceInfo> {
|
||||
public class SqlServerServiceInfoCreator extends RelationalServiceInfoCreator<SqlServerServiceInfo> {
|
||||
|
||||
public SqlServerServiceInfoCreator() {
|
||||
super(new Tags(), SqlServerServiceInfo.SQLSERVER_SCHEME); }
|
||||
super(new Tags(), SqlServerServiceInfo.SQLSERVER_SCHEME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SqlServerServiceInfo createServiceInfo(String id, String url) {
|
||||
return new SqlServerServiceInfo(id, url);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,12 +11,15 @@ public class SqlServerServiceInfo extends RelationalServiceInfo {
|
||||
public SqlServerServiceInfo(String id, String url) {
|
||||
super(id, url, JDBC_URL_TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJdbcUrl()
|
||||
{
|
||||
return String.format("jdbc:%s://%s:%d;database=%s;user=%s;password=%s;",
|
||||
jdbcUrlDatabaseType,
|
||||
|
||||
@Override
|
||||
public String getJdbcUrl() {
|
||||
if (getUriInfo().getUriString().startsWith(JDBC_PREFIX)) {
|
||||
return getUriInfo().getUriString();
|
||||
}
|
||||
|
||||
return String.format("jdbc:%s://%s:%d;database=%s;user=%s;password=%s",
|
||||
jdbcUrlDatabaseType,
|
||||
getHost(), getPort(), getPath(), getUserName(), getPassword());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user