Search in sources :

Example 1 with PostgresqlServiceInfo

use of org.springframework.cloud.service.common.PostgresqlServiceInfo in project spring-cloud-connectors by spring-cloud.

the class LocalConfigConnectorPostgresqlServiceTest method serviceCreation.

@Test
public void serviceCreation() {
    List<ServiceInfo> services = connector.getServiceInfos();
    ServiceInfo service = getServiceInfo(services, "ingres");
    assertNotNull(service);
    assertTrue(service instanceof PostgresqlServiceInfo);
    assertUriParameters((PostgresqlServiceInfo) service);
}
Also used : ServiceInfo(org.springframework.cloud.service.ServiceInfo) PostgresqlServiceInfo(org.springframework.cloud.service.common.PostgresqlServiceInfo) PostgresqlServiceInfo(org.springframework.cloud.service.common.PostgresqlServiceInfo) Test(org.junit.Test)

Example 2 with PostgresqlServiceInfo

use of org.springframework.cloud.service.common.PostgresqlServiceInfo in project spring-cloud-connectors by spring-cloud.

the class HerokuConnectorPostgresqlServiceTest method assertPostgresServiceCreated.

private void assertPostgresServiceCreated(String envVarName, String serviceInstanceName) {
    Map<String, String> env = new HashMap<String, String>();
    String postgresUrl = getRelationalServiceUrl("db");
    env.put(envVarName, postgresUrl);
    when(mockEnvironment.getEnv()).thenReturn(env);
    List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();
    ServiceInfo serviceInfo = getServiceInfo(serviceInfos, serviceInstanceName);
    assertNotNull(serviceInfo);
    assertTrue(serviceInfo instanceof PostgresqlServiceInfo);
    assertReleationServiceInfo((PostgresqlServiceInfo) serviceInfo, "db");
}
Also used : ServiceInfo(org.springframework.cloud.service.ServiceInfo) PostgresqlServiceInfo(org.springframework.cloud.service.common.PostgresqlServiceInfo) HashMap(java.util.HashMap) PostgresqlServiceInfo(org.springframework.cloud.service.common.PostgresqlServiceInfo)

Aggregations

ServiceInfo (org.springframework.cloud.service.ServiceInfo)2 PostgresqlServiceInfo (org.springframework.cloud.service.common.PostgresqlServiceInfo)2 HashMap (java.util.HashMap)1 Test (org.junit.Test)1