Skip to content

Commit 503d735

Browse files
izeyesnicoll
authored andcommitted
Polish
Closes gh-7081
1 parent 8feef45 commit 503d735

File tree

11 files changed

+26
-59
lines changed

11 files changed

+26
-59
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public static ConditionMessage empty() {
141141
/**
142142
* Factory method to create a new {@link ConditionMessage} with a specific message.
143143
* @param message the source message (may be a format string if {@code args} are
144-
* specified
144+
* specified)
145145
* @param args format arguments for the message
146146
* @return a new {@link ConditionMessage} instance
147147
*/
@@ -155,7 +155,7 @@ public static ConditionMessage of(String message, Object... args) {
155155
/**
156156
* Factory method to create a new {@link ConditionMessage} comprised of the specified
157157
* messages.
158-
* @param messages the source messages (may be {@code null}
158+
* @param messages the source messages (may be {@code null})
159159
* @return a new {@link ConditionMessage} instance
160160
*/
161161
public static ConditionMessage of(Collection<? extends ConditionMessage> messages) {
@@ -283,7 +283,7 @@ public ConditionMessage available(String item) {
283283

284284
/**
285285
* Indicates something is not available. For example {@code notAvailable("time")}
286-
* results in the message "time in not available".
286+
* results in the message "time is not available".
287287
* @param item the item that is not available
288288
* @return a built {@link ConditionMessage}
289289
*/
@@ -374,9 +374,9 @@ public ConditionMessage items(Collection<?> items) {
374374
}
375375

376376
/**
377-
* Indicate the items. For example
378-
* {@code didNotFind("bean", "beans").items(Collections.singleton("x")} results in
379-
* the message "did not find bean x".
377+
* Indicate the items with a {@link Style}. For example
378+
* {@code didNotFind("bean", "beans").items(Style.QUOTE, Collections.singleton("x")} results in
379+
* the message "did not find bean 'x'".
380380
* @param style the render style
381381
* @param items the source of the items (may be {@code null})
382382
* @return a built {@link ConditionMessage}

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionMessageTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public void foundExactlyShouldConstructMessage() throws Exception {
132132
}
133133

134134
@Test
135-
public void foundWhenSingleElementShouldUsingSingular() throws Exception {
135+
public void foundWhenSingleElementShouldUseSingular() throws Exception {
136136
ConditionMessage message = ConditionMessage.forCondition(Test.class)
137137
.found("bean", "beans").items("a");
138138
assertThat(message.toString()).isEqualTo("@Test found bean a");
@@ -160,7 +160,7 @@ public void foundWhenQuoteStyleShouldQuote() throws Exception {
160160
}
161161

162162
@Test
163-
public void didNotFindWhenSingleElementShouldUsingSingular() throws Exception {
163+
public void didNotFindWhenSingleElementShouldUseSingular() throws Exception {
164164
ConditionMessage message = ConditionMessage.forCondition(Test.class)
165165
.didNotFind("class", "classes").items("a");
166166
assertThat(message.toString()).isEqualTo("@Test did not find class a");

spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/OnInitializedRestarterCondition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.springframework.core.type.AnnotatedTypeMetadata;
2525

2626
/**
27-
* {@link Condition} that checks that a {@link Restarter} is available an initialized.
27+
* {@link Condition} that checks that a {@link Restarter} is available and initialized.
2828
*
2929
* @author Phillip Webb
3030
* @see ConditionalOnInitializedRestarter
@@ -35,7 +35,7 @@ class OnInitializedRestarterCondition extends SpringBootCondition {
3535
public ConditionOutcome getMatchOutcome(ConditionContext context,
3636
AnnotatedTypeMetadata metadata) {
3737
ConditionMessage.Builder message = ConditionMessage
38-
.forCondition("Initializer Restarter Condition");
38+
.forCondition("Initialized Restarter Condition");
3939
Restarter restarter = getRestarter();
4040
if (restarter == null) {
4141
return ConditionOutcome.noMatch(message.because("unavailable"));

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ can send us a {github-code}[pull request].
2424

2525
[[howto-failure-analyzer]]
2626
=== Create your own FailureAnalyzer
27-
{dc-spring-boot}/diagnostics/FailureAnalyzer.{dc-ext}[[`FailureAnalyzer`] is a great way
27+
{dc-spring-boot}/diagnostics/FailureAnalyzer.{dc-ext}[`FailureAnalyzer`] is a great way
2828
to intercept an exception on startup and turn it into a human-readable message, wrapped
29-
into a {dc-spring-boot}/diagnostics/FailureAnalysis.{dc-ext}[[`FailureAnalysis`]. Spring
29+
into a {dc-spring-boot}/diagnostics/FailureAnalysis.{dc-ext}[`FailureAnalysis`]. Spring
3030
Boot provides such analyzer for application context related exceptions, JSR-303
3131
validations and more. It is actually very easy to create your own.
3232

3333
`AbstractFailureAnalyzer` is a convenient extension of `FailureAnalyzer` that checks the
3434
presence of a specified exception type in the exception to handle. You can extend from
3535
that so that your implementation gets a chance to handle the exception only when it is
3636
actually present. If for whatever reason you can't handle the exception, return `null`
37-
to let another implementation a chance to handle the exception.
37+
to give another implementation a chance to handle the exception.
3838

3939
`FailureAnalyzer` implementations are to be registered in a `META-INF/spring.factories`:
4040
the following registers `ProjectConstraintViolationFailureAnalyzer`:
@@ -2652,7 +2652,7 @@ then be depended upon by your application and other projects.
26522652
If you cannot rearrange your code as recommended above, Spring Boot's Maven and Gradle
26532653
plugins must be configured to produce a separate artifact that is suitable for use as a
26542654
dependency. The executable archive cannot be used as a dependency as the
2655-
<<appendix-executable-jar-format.adoc#executable-jar-jar-file-structure,exectuable jar
2655+
<<appendix-executable-jar-format.adoc#executable-jar-jar-file-structure,executable jar
26562656
format>> packages application classes in `BOOT-INF/classes`. This means
26572657
that they cannot be found when the executable jar is used as a dependency.
26582658

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5266,7 +5266,7 @@ Data JPA tests may also inject a
52665266
bean which provides an alternative to the standard JPA `EntityManager` specifically
52675267
designed for tests. If you want to use `TestEntityManager` outside of `@DataJpaTests` you
52685268
can also use the `@AutoConfigureTestEntityManager` annotation. A `JdbcTemplate` is also
5269-
available should you need that.
5269+
available if you need that.
52705270

52715271
[source,java,indent=0]
52725272
----

spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperIntegrationTests.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.springframework.boot.test.context.TestConfiguration;
2525
import org.springframework.context.ApplicationContext;
2626
import org.springframework.context.annotation.Bean;
27-
import org.springframework.stereotype.Component;
2827
import org.springframework.test.context.BootstrapWith;
2928
import org.springframework.test.context.junit4.SpringRunner;
3029

@@ -83,9 +82,4 @@ static class ExampleBean {
8382

8483
}
8584

86-
@Component
87-
static class ExampleTestComponent {
88-
89-
}
90-
9185
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ public void parseSpyBeanOnClassAndField() throws Exception {
169169
QualifierDefinition qualifier = QualifierDefinition.forElement(
170170
ReflectionUtils.findField(SpyBeanOnClassAndField.class, "caller"));
171171
assertThat(fieldDefinition.getQualifier()).isNotNull().isEqualTo(qualifier);
172+
assertThat(fieldDefinition.getTypeToSpy().resolve())
173+
.isEqualTo(ExampleServiceCaller.class);
172174
}
173175

174176
@Test

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
/**
3737
* Test {@link MockBean} on a test class field can be used to replace existing bean while
3838
* preserving qualifiers.
39+
*
40+
* @author Stephane Nicoll
41+
* @author Phillip Webb
3942
*/
4043
@RunWith(SpringRunner.class)
4144
public class MockBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests {

spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/example/CustomQualifier.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121

2222
import org.springframework.beans.factory.annotation.Qualifier;
2323

24+
/**
25+
* Custom qualifier for testing.
26+
*
27+
* @author Stephane Nicoll
28+
*/
2429
@Qualifier
2530
@Retention(RetentionPolicy.RUNTIME)
2631
public @interface CustomQualifier {

spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/example/MyMockBean.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)