Skip to content

Commit cd5266a

Browse files
committed
Polish
1 parent 80ac4f8 commit cd5266a

File tree

28 files changed

+71
-70
lines changed

28 files changed

+71
-70
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerPropertiesTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializerPostProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQPropertiesTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfigurationTests.java

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -40,69 +40,59 @@
4040
*/
4141
public class ReactiveWebServerFactoryAutoConfigurationTests {
4242

43-
private ReactiveWebApplicationContextRunner contextRunner =
44-
new ReactiveWebApplicationContextRunner(AnnotationConfigReactiveWebServerApplicationContext::new)
45-
.withConfiguration(AutoConfigurations.of(ReactiveWebServerFactoryAutoConfiguration.class));
43+
private ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner(
44+
AnnotationConfigReactiveWebServerApplicationContext::new)
45+
.withConfiguration(AutoConfigurations
46+
.of(ReactiveWebServerFactoryAutoConfiguration.class));
4647

4748
@Test
4849
public void createFromConfigClass() {
49-
this.contextRunner
50-
.withUserConfiguration(MockWebServerAutoConfiguration.class,
51-
HttpHandlerConfiguration.class)
52-
.run(context -> {
50+
this.contextRunner.withUserConfiguration(MockWebServerAutoConfiguration.class,
51+
HttpHandlerConfiguration.class).run((context) -> {
5352
assertThat(context.getBeansOfType(ReactiveWebServerFactory.class))
5453
.hasSize(1);
5554
assertThat(context.getBeansOfType(WebServerFactoryCustomizer.class))
5655
.hasSize(1);
57-
assertThat(context.getBeansOfType(ReactiveWebServerFactoryCustomizer.class))
58-
.hasSize(1);
56+
assertThat(context
57+
.getBeansOfType(ReactiveWebServerFactoryCustomizer.class))
58+
.hasSize(1);
5959
});
6060
}
6161

6262
@Test
6363
public void missingHttpHandler() {
64-
this.contextRunner
65-
.withUserConfiguration(MockWebServerAutoConfiguration.class)
66-
.run(context -> {
67-
assertThat(context.getStartupFailure())
68-
.isInstanceOf(ApplicationContextException.class)
69-
.hasMessageContaining("missing HttpHandler bean");
70-
});
64+
this.contextRunner.withUserConfiguration(MockWebServerAutoConfiguration.class)
65+
.run((context) -> assertThat(context.getStartupFailure())
66+
.isInstanceOf(ApplicationContextException.class)
67+
.hasMessageContaining("missing HttpHandler bean"));
7168
}
7269

7370
@Test
7471
public void multipleHttpHandler() {
7572
this.contextRunner
7673
.withUserConfiguration(MockWebServerAutoConfiguration.class,
7774
HttpHandlerConfiguration.class, TooManyHttpHandlers.class)
78-
.run(context -> {
79-
assertThat(context.getStartupFailure())
80-
.isInstanceOf(ApplicationContextException.class)
81-
.hasMessageContaining("multiple HttpHandler beans : " +
82-
"httpHandler,additionalHttpHandler");
83-
});
75+
.run((context) -> assertThat(context.getStartupFailure())
76+
.isInstanceOf(ApplicationContextException.class)
77+
.hasMessageContaining("multiple HttpHandler beans : "
78+
+ "httpHandler,additionalHttpHandler"));
8479
}
8580

8681
@Test
8782
public void customizeReactiveWebServer() {
88-
this.contextRunner
89-
.withUserConfiguration(MockWebServerAutoConfiguration.class,
90-
HttpHandlerConfiguration.class, ReactiveWebServerCustomization.class)
91-
.run(context -> {
92-
assertThat(context.getBean(MockReactiveWebServerFactory.class).getPort())
93-
.isEqualTo(9000);
94-
});
83+
this.contextRunner.withUserConfiguration(MockWebServerAutoConfiguration.class,
84+
HttpHandlerConfiguration.class, ReactiveWebServerCustomization.class)
85+
.run((context) -> assertThat(
86+
context.getBean(MockReactiveWebServerFactory.class).getPort())
87+
.isEqualTo(9000));
9588
}
9689

9790
@Test
9891
public void defaultWebServerIsTomcat() {
9992
// Tomcat should be chosen over Netty if the Tomcat library is present.
100-
this.contextRunner
101-
.withUserConfiguration(HttpHandlerConfiguration.class)
102-
.run(context -> {
103-
assertThat(context.getBean(ReactiveWebServerFactory.class))
104-
.isInstanceOf(TomcatReactiveWebServerFactory.class);
105-
});
93+
this.contextRunner.withUserConfiguration(HttpHandlerConfiguration.class).run(
94+
(context) -> assertThat(context.getBean(ReactiveWebServerFactory.class))
95+
.isInstanceOf(TomcatReactiveWebServerFactory.class));
10696
}
10797

10898
@Configuration

spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/DefinitionsParserTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBeanTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/City.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -74,4 +74,5 @@ public String getMap() {
7474
public String toString() {
7575
return getName() + "," + getState() + "," + getCountry();
7676
}
77+
7778
}

spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Hotel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -80,4 +80,5 @@ public String getAddress() {
8080
public String getZip() {
8181
return this.zip;
8282
}
83+
8384
}

spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Rating.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@
1717
package sample.data.jpa.domain;
1818

1919
public enum Rating {
20+
2021
TERRIBLE, POOR, AVERAGE, GOOD, EXCELLENT
22+
2123
}

spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Review.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -128,4 +128,5 @@ public String getDetails() {
128128
public void setDetails(String details) {
129129
this.details = details;
130130
}
131+
131132
}

spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/ReviewDetails.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2013 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -75,4 +75,5 @@ public String getDetails() {
7575
public void setDetails(String details) {
7676
this.details = details;
7777
}
78+
7879
}

spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/TripType.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2013 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,5 +17,7 @@
1717
package sample.data.jpa.domain;
1818

1919
public enum TripType {
20+
2021
BUSINESS, COUPLES, FAMILY, FRIENDS, SOLO
22+
2123
}

spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/CitySearchCriteria.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2013 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,4 +41,5 @@ public String getName() {
4141
public void setName(String name) {
4242
this.name = name;
4343
}
44+
4445
}

spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/CityServiceImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -75,4 +75,5 @@ public Page<HotelSummary> getHotels(City city, Pageable pageable) {
7575
Assert.notNull(city, "City must not be null");
7676
return this.hotelRepository.findByCity(city, pageable);
7777
}
78+
7879
}

spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/HotelServiceImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -94,5 +94,7 @@ public long getNumberOfReviewsWithRating(Rating rating) {
9494
Long count = this.ratingCount.get(rating);
9595
return count == null ? 0 : count;
9696
}
97+
9798
}
99+
98100
}

spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/CityRepositoryIntegrationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,8 +41,8 @@ public class CityRepositoryIntegrationTests {
4141

4242
@Test
4343
public void findsFirstPageOfCities() {
44-
4544
Page<City> cities = this.repository.findAll(PageRequest.of(0, 10));
4645
assertThat(cities.getTotalElements()).isGreaterThan(20L);
4746
}
47+
4848
}

spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/HotelRepositoryIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,6 +45,7 @@ public class HotelRepositoryIntegrationTests {
4545

4646
@Autowired
4747
CityRepository cityRepository;
48+
4849
@Autowired
4950
HotelRepository repository;
5051

@@ -53,16 +54,15 @@ public void executesQueryMethodsCorrectly() {
5354
City city = this.cityRepository
5455
.findAll(PageRequest.of(0, 1, Direction.ASC, "name")).getContent().get(0);
5556
assertThat(city.getName()).isEqualTo("Atlanta");
56-
5757
Page<HotelSummary> hotels = this.repository.findByCity(city,
5858
PageRequest.of(0, 10, Direction.ASC, "name"));
5959
Hotel hotel = this.repository.findByCityAndName(city,
6060
hotels.getContent().get(0).getName());
6161
assertThat(hotel.getName()).isEqualTo("Doubletree");
62-
6362
List<RatingCount> counts = this.repository.findRatingCounts(hotel);
6463
assertThat(counts).hasSize(1);
6564
assertThat(counts.get(0).getRating()).isEqualTo(Rating.AVERAGE);
6665
assertThat(counts.get(0).getCount()).isGreaterThan(1L);
6766
}
67+
6868
}

spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/City.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -74,4 +74,5 @@ public String getMap() {
7474
public String toString() {
7575
return getName() + "," + getState() + "," + getCountry();
7676
}
77+
7778
}

spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/Hotel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -74,4 +74,5 @@ public String getAddress() {
7474
public String getZip() {
7575
return this.zip;
7676
}
77+
7778
}

spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/service/CitySearchCriteria.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2015 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,4 +41,5 @@ public String getName() {
4141
public void setName(String name) {
4242
this.name = name;
4343
}
44+
4445
}

spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/SampleDataRestApplicationTests.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,12 @@ public void setUp() {
5858

5959
@Test
6060
public void testHome() throws Exception {
61-
6261
this.mvc.perform(get("/api")).andExpect(status().isOk())
6362
.andExpect(content().string(containsString("hotels")));
6463
}
6564

6665
@Test
6766
public void findByNameAndCountry() throws Exception {
68-
6967
this.mvc.perform(get(
7068
"/api/cities/search/findByNameAndCountryAllIgnoringCase?name=Melbourne&country=Australia"))
7169
.andExpect(status().isOk())
@@ -75,10 +73,10 @@ public void findByNameAndCountry() throws Exception {
7573

7674
@Test
7775
public void findByContaining() throws Exception {
78-
7976
this.mvc.perform(get(
8077
"/api/cities/search/findByNameContainingAndCountryContainingAllIgnoringCase?name=&country=UK"))
8178
.andExpect(status().isOk())
8279
.andExpect(jsonPath("_embedded.cities", hasSize(3)));
8380
}
81+
8482
}

0 commit comments

Comments
 (0)