Remove strict check for 'amqp' scheme in AmqpServiceInfo
This commit is contained in:
@@ -31,8 +31,8 @@ public class AmqpServiceInfo extends UriBasedServiceInfo {
|
||||
|
||||
@Override
|
||||
protected UriInfo validateAndCleanUriInfo(UriInfo uriInfo) {
|
||||
if (!URI_SCHEME.equals(uriInfo.getScheme())) {
|
||||
throw new IllegalArgumentException("wrong scheme in amqp URI: " + uriInfo);
|
||||
if (uriInfo.getScheme() == null) {
|
||||
throw new IllegalArgumentException("missing scheme in amqp URI: " + uriInfo);
|
||||
}
|
||||
|
||||
if (uriInfo.getHost() == null) {
|
||||
|
||||
@@ -21,10 +21,15 @@ public class RabbitServiceInfoTest {
|
||||
assertEquals("mypass", serviceInfo.getPassword());
|
||||
assertEquals("myvhost", serviceInfo.getVirtualHost());
|
||||
}
|
||||
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void badProtocol() {
|
||||
new AmqpServiceInfo("id", "XX://myuser:mypass@myhost:12345/myvhost");
|
||||
public void missingScheme() {
|
||||
new AmqpServiceInfo("id", "://myuser:mypass@:12345/myvhost");
|
||||
}
|
||||
|
||||
public void amqpsSchemeAccepted() {
|
||||
AmqpServiceInfo serviceInfo = new AmqpServiceInfo("id", "amqps://myuser:mypass@myhost:12345/myvhost");
|
||||
assertEquals("amqps", serviceInfo.getScheme());
|
||||
}
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
|
||||
Reference in New Issue
Block a user