Skip to content

Commit d2ee817

Browse files
committed
Merge pull request #10948 from izeye:polish-20171108
* pr/10948: Polish
2 parents 2de0247 + cbb4837 commit d2ee817

File tree

19 files changed

+37
-41
lines changed

19 files changed

+37
-41
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public DataSource secondOne() {
134134
}
135135

136136
private DataSource createDataSource() {
137-
String url = "jdbc:hsqldb:mem:test-" + UUID.randomUUID().toString();
137+
String url = "jdbc:hsqldb:mem:test-" + UUID.randomUUID();
138138
return DataSourceBuilder.create().url(url).build();
139139
}
140140

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/integration/SpringIntegrationMetrics.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ public SpringIntegrationMetrics(IntegrationManagementConfigurer configurer,
6363

6464
@Override
6565
public void bindTo(MeterRegistry registry) {
66-
registerGuage(registry, this.configurer, this.tags,
66+
registerGauge(registry, this.configurer, this.tags,
6767
"spring.integration.channelNames",
6868
"The number of spring integration channels",
6969
(configurer) -> configurer.getChannelNames().length);
70-
registerGuage(registry, this.configurer, this.tags,
70+
registerGauge(registry, this.configurer, this.tags,
7171
"spring.integration.handlerNames",
7272
"The number of spring integration handlers",
7373
(configurer) -> configurer.getHandlerNames().length);
74-
registerGuage(registry, this.configurer, this.tags,
74+
registerGauge(registry, this.configurer, this.tags,
7575
"spring.integration.sourceNames",
7676
"The number of spring integration sources",
7777
(configurer) -> configurer.getSourceNames().length);
@@ -105,7 +105,7 @@ private void addHandlerMetrics(MeterRegistry registry) {
105105
registerTimedGauge(registry, handlerMetrics, tagsWithHandler,
106106
"spring.integration.handler.duration.mean",
107107
"The mean handler duration", MessageHandlerMetrics::getMeanDuration);
108-
registerGuage(registry, handlerMetrics, tagsWithHandler,
108+
registerGauge(registry, handlerMetrics, tagsWithHandler,
109109
"spring.integration.handler.activeCount",
110110
"The number of active handlers",
111111
MessageHandlerMetrics::getActiveCount);
@@ -133,7 +133,7 @@ private void addChannelMetrics(MeterRegistry registry) {
133133
}
134134
}
135135

136-
private <T> void registerGuage(MeterRegistry registry, T object, Iterable<Tag> tags,
136+
private <T> void registerGauge(MeterRegistry registry, T object, Iterable<Tag> tags,
137137
String name, String description, ToDoubleFunction<T> value) {
138138
Gauge.Builder<?> builder = Gauge.builder(name, object, value);
139139
builder.tags(this.tags).description(description).register(registry);

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void statusMustNotBeNull() throws Exception {
4545
public void createWithStatus() throws Exception {
4646
Health health = Health.status(Status.UP).build();
4747
assertThat(health.getStatus()).isEqualTo(Status.UP);
48-
assertThat(health.getDetails().size()).isEqualTo(0);
48+
assertThat(health.getDetails()).isEmpty();
4949
}
5050

5151
@Test
@@ -100,7 +100,7 @@ public void unknownWithDetails() throws Exception {
100100
public void unknown() throws Exception {
101101
Health health = new Health.Builder().unknown().build();
102102
assertThat(health.getStatus()).isEqualTo(Status.UNKNOWN);
103-
assertThat(health.getDetails().size()).isEqualTo(0);
103+
assertThat(health.getDetails()).isEmpty();
104104
}
105105

106106
@Test
@@ -114,7 +114,7 @@ public void upWithDetails() throws Exception {
114114
public void up() throws Exception {
115115
Health health = new Health.Builder().up().build();
116116
assertThat(health.getStatus()).isEqualTo(Status.UP);
117-
assertThat(health.getDetails().size()).isEqualTo(0);
117+
assertThat(health.getDetails()).isEmpty();
118118
}
119119

120120
@Test
@@ -130,28 +130,28 @@ public void downWithException() throws Exception {
130130
public void down() throws Exception {
131131
Health health = Health.down().build();
132132
assertThat(health.getStatus()).isEqualTo(Status.DOWN);
133-
assertThat(health.getDetails().size()).isEqualTo(0);
133+
assertThat(health.getDetails()).isEmpty();
134134
}
135135

136136
@Test
137137
public void outOfService() throws Exception {
138138
Health health = Health.outOfService().build();
139139
assertThat(health.getStatus()).isEqualTo(Status.OUT_OF_SERVICE);
140-
assertThat(health.getDetails().size()).isEqualTo(0);
140+
assertThat(health.getDetails()).isEmpty();
141141
}
142142

143143
@Test
144144
public void statusCode() throws Exception {
145145
Health health = Health.status("UP").build();
146146
assertThat(health.getStatus()).isEqualTo(Status.UP);
147-
assertThat(health.getDetails().size()).isEqualTo(0);
147+
assertThat(health.getDetails()).isEmpty();
148148
}
149149

150150
@Test
151151
public void status() throws Exception {
152152
Health health = Health.status(Status.UP).build();
153153
assertThat(health.getStatus()).isEqualTo(Status.UP);
154-
assertThat(health.getDetails().size()).isEqualTo(0);
154+
assertThat(health.getDetails()).isEmpty();
155155
}
156156

157157
}

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/info/EnvironmentInfoContributorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void extractOnlyInfoProperty() {
5050
public void extractNoEntry() {
5151
TestPropertyValues.of("foo=bar").applyTo(this.environment);
5252
Info actual = contributeFrom(this.environment);
53-
assertThat(actual.getDetails().size()).isEqualTo(0);
53+
assertThat(actual.getDetails()).isEmpty();
5454
}
5555

5656
@Test

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
6969

7070
/**
71-
* Tests for {@link WebMvcMetricsFilter}
71+
* Tests for {@link WebMvcMetricsFilter}.
7272
*
7373
* @author Jon Schneider
7474
*/

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private boolean isDataSourceAutoCommitDisabled() {
154154

155155
private boolean runningOnWebSphere() {
156156
return ClassUtils.isPresent(
157-
"com.ibm.websphere.jtaextensions." + "ExtendedJTATransaction",
157+
"com.ibm.websphere.jtaextensions.ExtendedJTATransaction",
158158
getClass().getClassLoader());
159159
}
160160

@@ -175,7 +175,7 @@ private void configureSpringJtaPlatform(Map<String, Object> vendorProperties,
175175
}
176176
catch (LinkageError ex) {
177177
// NoClassDefFoundError can happen if Hibernate 4.2 is used and some
178-
// containers (e.g. JBoss EAP 6) wraps it in the superclass LinkageError
178+
// containers (e.g. JBoss EAP 6) wrap it in the superclass LinkageError
179179
if (!isUsingJndi()) {
180180
throw new IllegalStateException("Unable to set Hibernate JTA "
181181
+ "platform, are you using the correct "

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializerInvokerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
import static org.junit.Assert.fail;
5151

5252
/**
53-
* Tests for {@link DataSourceInitializer}.
53+
* Tests for {@link DataSourceInitializerInvoker}.
5454
*
5555
* @author Dave Syer
5656
* @author Stephane Nicoll
@@ -61,7 +61,7 @@ public class DataSourceInitializerInvokerTests {
6161
.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class))
6262
.withPropertyValues("spring.datasource.initialization-mode=never",
6363
"spring.datasource.url:jdbc:hsqldb:mem:init-"
64-
+ UUID.randomUUID().toString());
64+
+ UUID.randomUUID());
6565

6666
@Test
6767
public void dataSourceInitialized() {

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void initializeOnlyEmbeddedByDefault() throws SQLException {
102102

103103
private HikariDataSource createDataSource() {
104104
return DataSourceBuilder.create().type(HikariDataSource.class)
105-
.url("jdbc:h2:mem:" + UUID.randomUUID().toString()).build();
105+
.url("jdbc:h2:mem:" + UUID.randomUUID()).build();
106106
}
107107

108108
}

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceJmxConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private void load(String... environment) {
113113

114114
private void load(Class<?> config, String... environment) {
115115
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
116-
String jdbcUrl = "jdbc:hsqldb:mem:test-" + UUID.randomUUID().toString();
116+
String jdbcUrl = "jdbc:hsqldb:mem:test-" + UUID.randomUUID();
117117
TestPropertyValues.of(environment).and("spring.datasource.url=" + jdbcUrl)
118118
.applyTo(context);
119119
if (config != null) {

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/AbstractJpaAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public DataSource secondDataSource() {
254254
}
255255

256256
private DataSource createRandomDataSource() {
257-
String url = "jdbc:h2:mem:init-" + UUID.randomUUID().toString();
257+
String url = "jdbc:h2:mem:init-" + UUID.randomUUID();
258258
return DataSourceBuilder.create().url(url).build();
259259
}
260260

@@ -275,7 +275,7 @@ public DataSource secondDataSource() {
275275
}
276276

277277
private DataSource createRandomDataSource() {
278-
String url = "jdbc:h2:mem:init-" + UUID.randomUUID().toString();
278+
String url = "jdbc:h2:mem:init-" + UUID.randomUUID();
279279
return DataSourceBuilder.create().url(url).build();
280280
}
281281

0 commit comments

Comments
 (0)