Commit 5c5eafe5 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #6671 from izeye:polish-20160817

* pr/6671:
  Polish
parents 96d5def1 37c8c366
...@@ -94,7 +94,6 @@ public class RabbitAutoConfiguration { ...@@ -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());
} }
......
...@@ -243,7 +243,7 @@ public class RabbitProperties { ...@@ -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 { ...@@ -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 = "/";
......
...@@ -122,7 +122,7 @@ public class RabbitPropertiesTests { ...@@ -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 { ...@@ -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
......
...@@ -68,8 +68,7 @@ public class JerseyAutoConfigurationObjectMapperProviderTests { ...@@ -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
......
...@@ -1415,7 +1415,7 @@ for example: ...@@ -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"]
......
...@@ -4059,7 +4059,7 @@ resolved against their provided names. ...@@ -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
......
...@@ -133,7 +133,7 @@ ...@@ -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">
......
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
*/ */
/** /**
* General actuator system support classes. * General system support classes.
*/ */
package org.springframework.boot.system; package org.springframework.boot.system;
...@@ -237,7 +237,6 @@ public class PropertySourcesPropertyValuesTests { ...@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment