Polish
Closes gh-6671
This commit is contained in:
committed by
Stephane Nicoll
parent
96d5def17d
commit
37c8c3669b
@@ -94,7 +94,6 @@ public class RabbitAutoConfiguration {
|
||||
factory.setHost(config.determineHost());
|
||||
}
|
||||
factory.setPort(config.determinePort());
|
||||
factory.setHost(config.determineHost());
|
||||
if (config.determineUsername() != null) {
|
||||
factory.setUsername(config.determineUsername());
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ public class RabbitProperties {
|
||||
/**
|
||||
* If addresses have been set and the first address has a virtual host it is returned.
|
||||
* Otherwise returns the result of calling {@code getVirtualHost()}.
|
||||
* @return the password or {@code null}
|
||||
* @return the virtual host or {@code null}
|
||||
* @see #setAddresses(String)
|
||||
* @see #getVirtualHost()
|
||||
*/
|
||||
@@ -755,7 +755,7 @@ public class RabbitProperties {
|
||||
|
||||
private String parseVirtualHost(String input) {
|
||||
int hostIndex = input.indexOf("/");
|
||||
if (hostIndex >= 0 && hostIndex < input.length()) {
|
||||
if (hostIndex >= 0) {
|
||||
this.virtualHost = input.substring(hostIndex + 1);
|
||||
if (this.virtualHost.length() == 0) {
|
||||
this.virtualHost = "/";
|
||||
|
||||
@@ -122,7 +122,7 @@ public class RabbitPropertiesTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void determinedVirtualHostIsSlashWhenAddressHasTrailingSlash() {
|
||||
public void determineVirtualHostIsSlashWhenAddressHasTrailingSlash() {
|
||||
this.properties.setAddresses("amqp://root:password@otherhost:1111/");
|
||||
assertThat(this.properties.determineVirtualHost()).isEqualTo("/");
|
||||
}
|
||||
@@ -199,7 +199,7 @@ public class RabbitPropertiesTests {
|
||||
|
||||
@Test
|
||||
public void addressesDefaultsToNull() {
|
||||
assertThat(this.properties.getAddresses()).isEqualTo(null);
|
||||
assertThat(this.properties.getAddresses()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -68,8 +68,7 @@ public class JerseyAutoConfigurationObjectMapperProviderTests {
|
||||
ResponseEntity<String> response = this.restTemplate.getForEntity("/rest/message",
|
||||
String.class);
|
||||
assertThat(HttpStatus.OK).isEqualTo(response.getStatusCode());
|
||||
assertThat(response.getBody())
|
||||
.isEqualTo(String.format("{\"subject\":\"Jersey\"}"));
|
||||
assertThat(response.getBody()).isEqualTo("{\"subject\":\"Jersey\"}");
|
||||
}
|
||||
|
||||
@MinimalWebConfiguration
|
||||
|
||||
Reference in New Issue
Block a user