Closes gh-6671
This commit is contained in:
Johnny Lim 2016-08-17 11:17:11 +09:00 committed by Stephane Nicoll
parent 96d5def17d
commit 37c8c3669b
9 changed files with 9 additions and 12 deletions

View File

@ -94,7 +94,6 @@ public class RabbitAutoConfiguration {
factory.setHost(config.determineHost()); factory.setHost(config.determineHost());
} }
factory.setPort(config.determinePort()); factory.setPort(config.determinePort());
factory.setHost(config.determineHost());
if (config.determineUsername() != null) { if (config.determineUsername() != null) {
factory.setUsername(config.determineUsername()); factory.setUsername(config.determineUsername());
} }

View File

@ -243,7 +243,7 @@ public class RabbitProperties {
/** /**
* If addresses have been set and the first address has a virtual host it is returned. * If addresses have been set and the first address has a virtual host it is returned.
* Otherwise returns the result of calling {@code getVirtualHost()}. * 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 #setAddresses(String)
* @see #getVirtualHost() * @see #getVirtualHost()
*/ */
@ -755,7 +755,7 @@ public class RabbitProperties {
private String parseVirtualHost(String input) { private String parseVirtualHost(String input) {
int hostIndex = input.indexOf("/"); int hostIndex = input.indexOf("/");
if (hostIndex >= 0 && hostIndex < input.length()) { if (hostIndex >= 0) {
this.virtualHost = input.substring(hostIndex + 1); this.virtualHost = input.substring(hostIndex + 1);
if (this.virtualHost.length() == 0) { if (this.virtualHost.length() == 0) {
this.virtualHost = "/"; this.virtualHost = "/";

View File

@ -122,7 +122,7 @@ public class RabbitPropertiesTests {
} }
@Test @Test
public void determinedVirtualHostIsSlashWhenAddressHasTrailingSlash() { public void determineVirtualHostIsSlashWhenAddressHasTrailingSlash() {
this.properties.setAddresses("amqp://root:password@otherhost:1111/"); this.properties.setAddresses("amqp://root:password@otherhost:1111/");
assertThat(this.properties.determineVirtualHost()).isEqualTo("/"); assertThat(this.properties.determineVirtualHost()).isEqualTo("/");
} }
@ -199,7 +199,7 @@ public class RabbitPropertiesTests {
@Test @Test
public void addressesDefaultsToNull() { public void addressesDefaultsToNull() {
assertThat(this.properties.getAddresses()).isEqualTo(null); assertThat(this.properties.getAddresses()).isNull();
} }
@Test @Test

View File

@ -68,8 +68,7 @@ public class JerseyAutoConfigurationObjectMapperProviderTests {
ResponseEntity<String> response = this.restTemplate.getForEntity("/rest/message", ResponseEntity<String> response = this.restTemplate.getForEntity("/rest/message",
String.class); String.class);
assertThat(HttpStatus.OK).isEqualTo(response.getStatusCode()); assertThat(HttpStatus.OK).isEqualTo(response.getStatusCode());
assertThat(response.getBody()) assertThat(response.getBody()).isEqualTo("{\"subject\":\"Jersey\"}");
.isEqualTo(String.format("{\"subject\":\"Jersey\"}"));
} }
@MinimalWebConfiguration @MinimalWebConfiguration

View File

@ -1415,7 +1415,7 @@ for example:
---- ----
To avoid a warning message about the HTML 5 template mode being deprecated and the HTML To avoid a warning message about the HTML 5 template mode being deprecated and the HTML
template mode being used instead, you may also want to explicity configure template mode being used instead, you may also want to explicitly configure
`spring.thymeleaf.mode` to be `HTML`, for example: `spring.thymeleaf.mode` to be `HTML`, for example:
[source,properties,indent=0,subs="verbatim,quotes,attributes"] [source,properties,indent=0,subs="verbatim,quotes,attributes"]

View File

@ -4059,7 +4059,7 @@ resolved against their provided names.
Apache Artemis was formed in 2015 when HornetQ was donated to the Apache Foundation. Make Apache Artemis was formed in 2015 when HornetQ was donated to the Apache Foundation. Make
sure to use that rather than the deprecated HornetQ support. sure to use that rather than the deprecated HornetQ support.
NOTE: You should not try and use Artemis and HornetQ and the same time. NOTE: You should not try and use Artemis and HornetQ at the same time.
Spring Boot can auto-configure a `ConnectionFactory` when it detects that Artemis is Spring Boot can auto-configure a `ConnectionFactory` when it detects that Artemis is
available on the classpath. If the broker is present, an embedded broker is started and available on the classpath. If the broker is present, an embedded broker is started and

View File

@ -133,7 +133,7 @@
<property name="maximum" value="0"/> <property name="maximum" value="0"/>
<property name="format" value="org\.mockito\.Mockito\.(when|doThrow|doAnswer)" /> <property name="format" value="org\.mockito\.Mockito\.(when|doThrow|doAnswer)" />
<property name="message" <property name="message"
value="Please use BDDMockto imports." /> value="Please use BDDMockito imports." />
<property name="ignoreComments" value="true" /> <property name="ignoreComments" value="true" />
</module> </module>
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck"> <module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">

View File

@ -15,6 +15,6 @@
*/ */
/** /**
* General actuator system support classes. * General system support classes.
*/ */
package org.springframework.boot.system; package org.springframework.boot.system;

View File

@ -237,7 +237,6 @@ public class PropertySourcesPropertyValuesTests {
this.propertySources.addFirst(new MapPropertySource("s", second)); this.propertySources.addFirst(new MapPropertySource("s", second));
this.propertySources.addFirst(new MapPropertySource("f", first)); this.propertySources.addFirst(new MapPropertySource("f", first));
binder.bind(new PropertySourcesPropertyValues(this.propertySources)); binder.bind(new PropertySourcesPropertyValues(this.propertySources));
target.getList();
assertThat(target.getList()).hasSize(1); assertThat(target.getList()).hasSize(1);
assertThat(target.getList().get(0).getDescription()) assertThat(target.getList().get(0).getDescription())
.isEqualTo("another description"); .isEqualTo("another description");