Skip to content

Commit 2591abe

Browse files
committed
Merge pull request #5714 from izeye/polish-201417
* pr/5714: Polish
2 parents 15dee60 + 6d48ee9 commit 2591abe

File tree

23 files changed

+38
-38
lines changed

23 files changed

+38
-38
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public void explicitType() {
201201
}
202202

203203
@Test
204-
public void testExplicitDriverClassClearsUserName() throws Exception {
204+
public void testExplicitDriverClassClearsUsername() throws Exception {
205205
EnvironmentTestUtils.addEnvironment(this.context,
206206
"spring.datasource.driverClassName:"
207207
+ "org.springframework.boot.autoconfigure.jdbc."
@@ -302,7 +302,7 @@ public DataSource dataSource() {
302302

303303
}
304304

305-
// see testExplicitDriverClassClearsUserName
305+
// see testExplicitDriverClassClearsUsername
306306
public static class DatabaseTestDriver implements Driver {
307307

308308
@Override

spring-boot-docs/src/main/asciidoc/howto.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ the `spring-boot-actuator` there is also an `autoconfig` endpoint that renders t
3434
in JSON. Use that to debug the application and see what features have been added (and
3535
which not) by Spring Boot at runtime.
3636

37-
Many more questions can be answered by looking at the source code and the javadoc. Some
37+
Many more questions can be answered by looking at the source code and the Javadoc. Some
3838
rules of thumb:
3939

4040
* Look for classes called `+*AutoConfiguration+` and read their sources, in particular the

spring-boot-docs/src/main/asciidoc/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Phillip Webb; Dave Syer; Josh Long; Stéphane Nicoll; Rob Winch; Andy Wilkinson;
2424
:sc-spring-boot-cli: {github-code}/spring-boot-cli/src/main/java/org/springframework/boot/cli
2525
:sc-spring-boot-devtools: {github-code}/spring-boot-devtools/src/main/java/org/springframework/boot/devtools
2626
:sc-spring-boot-test: {github-code}/spring-boot-test/src/main/java/org/springframework/boot/test
27-
:sc-spring-boot-test-autoconfigure: {github-code}/spring-boot-test/src/main/java/org/springframework/boot/test/autoconfigure
27+
:sc-spring-boot-test-autoconfigure: {github-code}/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure
2828
:dc-ext: html
2929
:dc-root: http://docs.spring.io/spring-boot/docs/{spring-boot-docs-version}/api
3030
:dc-spring-boot: {dc-root}/org/springframework/boot

spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ further information.
514514
== What to read next
515515
There are some {github-code}/spring-boot-cli/samples[sample groovy
516516
scripts] available from the GitHub repository that you can use to try out the
517-
Spring Boot CLI. There is also extensive javadoc throughout the
517+
Spring Boot CLI. There is also extensive Javadoc throughout the
518518
{sc-spring-boot-cli}[source code].
519519

520520
If you find that you reach the limit of the CLI tool, you will probably want to look

spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4351,7 +4351,7 @@ Spring Boot provides a number of utilities and annotations to help when testing
43514351
application. Test support is provided by two modules; `spring-boot-test` contains core
43524352
items, and `spring-boot-test-autoconfigure` supports auto-configuration for tests.
43534353

4354-
Most developers will just use the the `spring-boot-starter-test` '`Starter POM`' which
4354+
Most developers will just use the `spring-boot-starter-test` '`Starter POM`' which
43554355
imports both Spring Boot test modules as well has JUnit, AssertJ, Hamcrest and a number
43564356
of other useful libraries.
43574357

@@ -4364,9 +4364,9 @@ If you use the
43644364
the following provided libraries:
43654365

43664366
* http://junit.org[JUnit] -- The de-facto standard for unit testing Java applications.
4367-
* {spring-reference}/#integration-testing.html[Spring Test] & Spring Boot Test -- utilities and integration test support for Spring Boot
4367+
* {spring-reference}/#integration-testing.html[Spring Test] & Spring Boot Test -- Utilities and integration test support for Spring Boot
43684368
applications.
4369-
* http://joel-costigliola.github.io/assertj/[AssertJ] - A fluent assertion library.
4369+
* http://joel-costigliola.github.io/assertj/[AssertJ] -- A fluent assertion library.
43704370
* http://hamcrest.org/JavaHamcrest/[Hamcrest] -- A library of matcher objects (also known
43714371
as constraints or predicates).
43724372
* http://mockito.org/[Mockito] -- A Java mocking framework.
@@ -4408,7 +4408,7 @@ features of Spring Boot are only installed in the context by default if you use
44084408
`SpringApplication` to create it.
44094409

44104410
Spring Boot provides a `@SpringBootTest` annotation which can be used as an
4411-
alternative the standard `spring-test` `@ContextConfiguration` annotation when you need
4411+
alternative to the standard `spring-test` `@ContextConfiguration` annotation when you need
44124412
Spring Boot features. The annotation works by creating the `ApplicationContext` used
44134413
in your tests via `SpringApplication`.
44144414

@@ -4425,7 +4425,7 @@ how your tests will run:
44254425
* `DEFINED_PORT` -- Loads an `EmbeddedWebApplicationContext` and provides a real
44264426
servlet environment. Embedded servlet containers are started and listening on a defined
44274427
port (i.e from your `application.properties` or on the default port `8080`).
4428-
* `NONE` -- Loads an `ApplicationContext` using `SpringApplication` but does not provides
4428+
* `NONE` -- Loads an `ApplicationContext` using `SpringApplication` but does not provide
44294429
_any_ servlet environment (mock or otherwise).
44304430

44314431
NOTE: In addition to `@SpringBootTest` a number of other annotations are also
@@ -4533,8 +4533,8 @@ failures that might be hard to trigger in a real environment.
45334533
Spring Boot includes a `@MockBean` annotation that can be used to define a Mockito mock
45344534
for a bean inside your `ApplicationContext`. You can use the annotation to add new beans,
45354535
or replace a single existing bean definition. The annotation can be used directly on test
4536-
classes, on fields within your test; or on `@Configuration` classes and fields. When used
4537-
on a field the, instance of the created mock will also be injected. Mock beans are
4536+
classes, on fields within your test, or on `@Configuration` classes and fields. When used
4537+
on a field, the instance of the created mock will also be injected. Mock beans are
45384538
automatically reset after each test method.
45394539

45404540
Here's a typical example where we replace an existing `RemoteService` bean with a mock
@@ -4574,7 +4574,7 @@ implementation:
45744574
----
45754575

45764576
Additionally you can also use `@SpyBean` to wrap any existing bean with a Mockito `spy`.
4577-
See the javadoc for full details.
4577+
See the Javadoc for full details.
45784578

45794579

45804580
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-tests]]
@@ -4583,11 +4583,11 @@ Spring Boot's auto-configuration system works well for applications, but can som
45834583
a little too much for tests. It's often helpful to load only the parts of the
45844584
configuration that are required to test a '`slice`' of your application. For example, you
45854585
might want to test that Spring MVC controllers are mapping URLs correctly, and you don't
4586-
want to involve and database calls in those tests; or you _might be wanting_ to test JPA
4586+
want to involve database calls in those tests; or you _might be wanting_ to test JPA
45874587
entities, and you're not interested in web layer when those tests run.
45884588

45894589
The `spring-boot-test-autoconfigure` module includes a number of annotations that can be
4590-
used to automatically configure such '`slices`'. Each of them work in a similar way,
4590+
used to automatically configure such '`slices`'. Each of them works in a similar way,
45914591
providing a `@...Test` annotation that loads the `ApplicationContext` and one or
45924592
more `@AutoConfigure...` annotations that can be used to customize auto-configuration
45934593
settings.
@@ -4601,7 +4601,7 @@ TIP: It's also possible to use the `@AutoConfigure...` annotations with the stan
46014601
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-json-tests]]
46024602
==== Auto-configured JSON tests
46034603
To test that Object JSON serialization and deserialization is working as expected you can
4604-
use the `@JsonTest` annotation. `@JsonTest` will auto-configure Jackson ObjectMappers,
4604+
use the `@JsonTest` annotation. `@JsonTest` will auto-configure Jackson `ObjectMapper`,
46054605
any `@JsonComponent` beans and any Jackson `Modules`. It also configures `Gson`
46064606
if you happen to be using that instead of, or as well as, Jackson. If you need to
46074607
configure elements of the auto-configuration you can use the `@AutoConfigureJsonTesters`
@@ -4751,7 +4751,7 @@ and/or a `WebDriver` bean. Here is an example that uses HtmlUnit:
47514751

47524752
[[boot-features-testing-spring-boot-applications-testing-autoconfigured-jpa-test]]
47534753
==== Auto-configured Data JPA tests
4754-
The `@DataJpaTest` can be used if want to test JPA applications. By default it will
4754+
The `@DataJpaTest` can be used if you want to test JPA applications. By default it will
47554755
configure an in-memory embedded database, scan for `@Entity` classes and configure Spring
47564756
Data JPA repositories. Regular `@Component` beans will not be loaded into the
47574757
`ApplicationContext`.

spring-boot-samples/spring-boot-sample-test/src/main/java/sample/test/domain/User.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public User(String username, VehicleIdentificationNumber vin) {
5050
this.vin = vin;
5151
}
5252

53-
protected Long getId() {
53+
public Long getId() {
5454
return this.id;
5555
}
5656

spring-boot-samples/spring-boot-sample-test/src/main/java/sample/test/domain/UserRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.springframework.data.repository.Repository;
2020

2121
/**
22-
* Domain repository for {@link User}
22+
* Domain repository for {@link User}.
2323
*
2424
* @author Phillip Webb
2525
*/

spring-boot-samples/spring-boot-sample-test/src/main/java/sample/test/web/UserVehicleController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.springframework.web.bind.annotation.RestController;
3030

3131
/**
32-
* Controller to return vehicle information for a given {@link User}
32+
* Controller to return vehicle information for a given {@link User}.
3333
*
3434
* @author Phillip Webb
3535
*/

spring-boot-samples/spring-boot-sample-test/src/test/java/sample/test/SampleTestApplicationWebIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import static org.mockito.BDDMockito.given;
3535

3636
/**
37-
* {@code @WebIntegrationTest} for {@link SampleTestApplication}.
37+
* {@code @SpringBootTest} with a random port for {@link SampleTestApplication}.
3838
*
3939
* @author Phillip Webb
4040
*/

spring-boot-samples/spring-boot-sample-test/src/test/java/sample/test/domain/UserEntityTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ public class UserEntityTests {
4747
private TestEntityManager entityManager;
4848

4949
@Test
50-
public void createWhenUserIdIsNullShouldThrowException() throws Exception {
50+
public void createWhenUsernameIsNullShouldThrowException() throws Exception {
5151
this.thrown.expect(IllegalArgumentException.class);
5252
this.thrown.expectMessage("Username must not be empty");
5353
new User(null, VIN);
5454
}
5555

5656
@Test
57-
public void createWhenUserIdIsEmptyShouldThrowException() throws Exception {
57+
public void createWhenUsernameIsEmptyShouldThrowException() throws Exception {
5858
this.thrown.expect(IllegalArgumentException.class);
5959
this.thrown.expectMessage("Username must not be empty");
6060
new User("", VIN);

0 commit comments

Comments
 (0)