Don't URL encode username and password fields for Oracle database.
This commit is contained in:
@@ -33,21 +33,6 @@ public class CloudFoundryConnectorOracleServiceTest extends AbstractUserProvided
|
||||
assertUriBasedServiceInfoFields(info, ORACLE_SCHEME, hostname, port, username, password, INSTANCE_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void oracleServiceCreationWithSpecialChars() {
|
||||
String userWithSpecialChars = "u%u:u+";
|
||||
String passwordWithSpecialChars = "p%p:p+";
|
||||
when(mockEnvironment.getEnvValue("VCAP_SERVICES"))
|
||||
.thenReturn(getServicesPayload(
|
||||
getUserProvidedServicePayload(SERVICE_NAME, hostname, port, userWithSpecialChars, passwordWithSpecialChars, INSTANCE_NAME, ORACLE_SCHEME + ":")));
|
||||
List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();
|
||||
|
||||
ServiceInfo info = getServiceInfo(serviceInfos, SERVICE_NAME);
|
||||
assertServiceFoundOfType(info, OracleServiceInfo.class);
|
||||
assertEquals(getJdbcUrl(hostname, port, INSTANCE_NAME, userWithSpecialChars, passwordWithSpecialChars), ((RelationalServiceInfo)info).getJdbcUrl());
|
||||
assertUriBasedServiceInfoFields(info, ORACLE_SCHEME, hostname, port, userWithSpecialChars, passwordWithSpecialChars, INSTANCE_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void oracleServiceCreationWithNoUri() {
|
||||
when(mockEnvironment.getEnvValue("VCAP_SERVICES"))
|
||||
|
||||
@@ -18,7 +18,7 @@ public class OracleServiceInfo extends RelationalServiceInfo {
|
||||
@Override
|
||||
protected String buildJdbcUrl() {
|
||||
return String.format("jdbc:%s:thin:%s/%s@%s:%d/%s",
|
||||
jdbcUrlDatabaseType, UriInfo.urlEncode(getUserName()), UriInfo.urlEncode(getPassword()),
|
||||
jdbcUrlDatabaseType, getUserName(), getPassword(),
|
||||
getHost(), getPort(), getPath());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user