use of org.springframework.cloud.service.common.AmqpServiceInfo in project spring-cloud-connectors by spring-cloud.
the class RabbitServiceInfoTest method amqpsSchemeAccepted.
@Test
public void amqpsSchemeAccepted() {
AmqpServiceInfo serviceInfo = new AmqpServiceInfo("id", "amqps://myuser:mypass@myhost:12345/myvhost");
assertEquals("amqps", serviceInfo.getScheme());
}
use of org.springframework.cloud.service.common.AmqpServiceInfo in project spring-cloud-connectors by spring-cloud.
the class LocalConfigConnectorAmqpServiceTest method serviceCreation.
@Test
public void serviceCreation() {
List<ServiceInfo> services = connector.getServiceInfos();
ServiceInfo service = getServiceInfo(services, "rabbit");
assertNotNull(service);
assertTrue(service instanceof AmqpServiceInfo);
assertUriParameters((AmqpServiceInfo) service);
}
use of org.springframework.cloud.service.common.AmqpServiceInfo in project spring-cloud-connectors by spring-cloud.
the class CloudFoundryConnectorAmqpServiceTest method qpidServiceCreationNoLabelNoTags.
@Test
public void qpidServiceCreationNoLabelNoTags() throws Exception {
when(mockEnvironment.getEnvValue("VCAP_SERVICES")).thenReturn(getServicesPayload(getQpidServicePayloadNoLabelNoTags("qpid-1", hostname, port, username, password, "q-1", "vhost1"), getQpidServicePayloadNoLabelNoTags("qpid-2", hostname, port, username, password, "q-2", "vhost2")));
List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();
assertServiceFoundOfType(serviceInfos, "qpid-1", AmqpServiceInfo.class);
assertServiceFoundOfType(serviceInfos, "qpid-2", AmqpServiceInfo.class);
AmqpServiceInfo serviceInfo = (AmqpServiceInfo) getServiceInfo(serviceInfos, "qpid-1");
assertNotNull(serviceInfo);
assertEquals(username, serviceInfo.getUserName());
assertEquals(password, serviceInfo.getPassword());
assertEquals("vhost1", serviceInfo.getVirtualHost());
URI uri = new URI(serviceInfo.getUri());
assertTrue(uri.getQuery().contains("tcp://" + hostname + ":" + port));
}
Aggregations