Polish SQL Server support and fix unit tests.

This commit is contained in:
Scott Frederick
2015-07-24 11:13:53 -05:00
parent 9e78abe2fc
commit 9b4139c8dd
2 changed files with 13 additions and 11 deletions

View File

@@ -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);
}
}

View File

@@ -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());
}
}
}