Skip to content

Commit a39e1c4

Browse files
izeyesnicoll
authored andcommitted
Polish
Signed-off-by: Johnny Lim <[email protected]> See gh-44034
1 parent a33b700 commit a39e1c4

File tree

10 files changed

+23
-32
lines changed

10 files changed

+23
-32
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/zipkin/ZipkinConfigurationsSenderConfigurationTests.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ZipkinConfigurationsSenderConfigurationTests {
4747
.withConfiguration(AutoConfigurations.of(DefaultEncodingConfiguration.class, SenderConfiguration.class));
4848

4949
@Test
50-
void shouldSupplyDefaultHttpClientSenderBeans() {
50+
void shouldSupplyDefaultHttpClientSenderBean() {
5151
this.contextRunner.run((context) -> {
5252
assertThat(context).hasSingleBean(BytesMessageSender.class);
5353
assertThat(context).hasSingleBean(ZipkinHttpClientSender.class);
@@ -56,7 +56,7 @@ void shouldSupplyDefaultHttpClientSenderBeans() {
5656
}
5757

5858
@Test
59-
void shouldUseUrlSenderIfHttpSenderIsNotAvailable() {
59+
void shouldUseUrlConnectionSenderIfHttpClientIsNotAvailable() {
6060
this.contextRunner.withUserConfiguration(UrlConnectionSenderConfiguration.class)
6161
.withClassLoader(new FilteredClassLoader(HttpClient.class))
6262
.run((context) -> {
@@ -85,16 +85,6 @@ void shouldUseCustomHttpEndpointSupplierFactory() {
8585
});
8686
}
8787

88-
@Configuration(proxyBeanMethods = false)
89-
private static final class HttpClientConfiguration {
90-
91-
@Bean
92-
ZipkinHttpClientBuilderCustomizer httpClientBuilderCustomizer() {
93-
return mock(ZipkinHttpClientBuilderCustomizer.class);
94-
}
95-
96-
}
97-
9888
@Configuration(proxyBeanMethods = false)
9989
private static final class CustomConfiguration {
10090

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/DefaultGraphQlSchemaCondition.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeM
8484
else {
8585
messages.add((message.didNotFind("GraphQlSourceBuilderCustomizer").atAll()));
8686
}
87-
String[] graphqlSourceBeans = beanFactory.getBeanNamesForType(GraphQlSource.class, false, false);
88-
if (graphqlSourceBeans.length != 0) {
87+
String[] graphQlSourceBeanNames = beanFactory.getBeanNamesForType(GraphQlSource.class, false, false);
88+
if (graphQlSourceBeanNames.length != 0) {
8989
match = true;
90-
messages.add(message.found("graphqlSource").items(Arrays.asList(graphqlSourceBeans)));
90+
messages.add(message.found("GraphQlSource").items(Arrays.asList(graphQlSourceBeanNames)));
9191
}
9292
else {
9393
messages.add((message.didNotFind("GraphQlSource").atAll()));

spring-boot-project/spring-boot-docs/src/docs/antora/modules/specification/pages/configuration-metadata/format.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
= Metadata Format
33

44
Configuration metadata files are located inside jars under `META-INF/spring-configuration-metadata.json`.
5-
They use a JSON format with items categorized under either "`groups`" or "`properties`", additional values hints categorized under "hints", and ignored items under "`ignored`" as shown in the following example:
5+
They use a JSON format with items categorized under either "`groups`" or "`properties`", additional values hints categorized under "`hints`", and ignored items under "`ignored`" as shown in the following example:
66

77
[source,json]
88
----
@@ -93,7 +93,7 @@ Some properties might exist in their own right.
9393
The "`hints`" are additional information used to assist the user in configuring a given property.
9494
For example, when a developer is configuring the configprop:spring.jpa.hibernate.ddl-auto[] property, a tool can use the hints to offer some auto-completion help for the `none`, `validate`, `update`, `create`, and `create-drop` values.
9595

96-
Finally, "`ignored`" are items which have been deliberately ignored.
96+
Finally, "`ignored`" is for items which have been deliberately ignored.
9797
The content of this section usually comes from the xref:specification:configuration-metadata/annotation-processor.adoc#appendix.configuration-metadata.annotation-processor.adding-additional-metadata[additional metadata].
9898

9999

@@ -313,8 +313,8 @@ The `ignored` object can contain the attributes shown in the following table:
313313
| Name | Type | Purpose
314314

315315
| `properties`
316-
| IgnoredProperty[]
317-
| A list of ignored properties as defined by the IgnoredProperty object (described in the next table). Each entry defines the name of the ignored property.
316+
| ItemIgnore[]
317+
| A list of ignored properties as defined by the ItemIgnore object (described in the next table). Each entry defines the name of the ignored property.
318318

319319
|===
320320

spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/ItemIgnore.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public final class ItemIgnore implements Comparable<ItemIgnore> {
3333
private final String name;
3434

3535
private ItemIgnore(ItemType type, String name) {
36-
if (name == null) {
37-
throw new IllegalArgumentException("'name' must not be null");
38-
}
3936
if (type == null) {
4037
throw new IllegalArgumentException("'type' must not be null");
4138
}
39+
if (name == null) {
40+
throw new IllegalArgumentException("'name' must not be null");
41+
}
4242
this.type = type;
4343
this.name = name;
4444
}

spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshaller.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ public ConfigurationMetadata read(InputStream inputStream) throws Exception {
9292
}
9393
JSONObject ignored = object.optJSONObject("ignored");
9494
if (ignored != null) {
95-
checkAllowedKeys(ignored, path.resolve("ignored"), "properties");
96-
addIgnoredProperties(metadata, ignored, path.resolve("ignored"));
95+
JsonPath ignoredPath = path.resolve("ignored");
96+
checkAllowedKeys(ignored, ignoredPath, "properties");
97+
addIgnoredProperties(metadata, ignored, ignoredPath);
9798
}
9899
return metadata;
99100
}

spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/JsonMarshallerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ void shouldCheckHintProviderFields() {
348348
}
349349

350350
@Test
351-
void shouldCheckIgnoreFields() {
351+
void shouldCheckIgnoredFields() {
352352
String json = """
353353
{
354354
"ignored": {
@@ -362,7 +362,7 @@ void shouldCheckIgnoreFields() {
362362
}
363363

364364
@Test
365-
void shouldCheckIgnorePropertiesFields() {
365+
void shouldCheckIgnoredPropertiesFields() {
366366
String json = """
367367
{
368368
"ignored": {

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataLocationResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private void validateProfile(String profile) {
182182
return;
183183
}
184184
throw new IllegalStateException(
185-
String.format("Invalid profile '%s': must contain only letters or digits or '-' or '_'", profile));
185+
String.format("Invalid profile '%s': must contain only letters, digits, '-', or '_'", profile));
186186
});
187187
}
188188

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/info/ProcessInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public MemoryInfo getMemory() {
8888
* threads, the parallelism level, and the thread pool size.
8989
* @return an instance of {@link VirtualThreadsInfo} containing information about
9090
* virtual threads, or {@code null} if the VirtualThreadSchedulerMXBean is not
91-
* available.
91+
* available
9292
* @since 3.5.0
9393
*/
9494
@SuppressWarnings("unchecked")

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/StandardConfigDataLocationResolverTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ void resolveProfileSpecificWithAdditionalValidProfilesShouldNotThrowException()
322322
}
323323

324324
@Test
325-
void resolveProfileSpecificWhenProfileStartsWithSymbolThrowsException() {
325+
void resolveProfileSpecificWhenProfileStartsWithDashThrowsException() {
326326
ConfigDataLocation location = ConfigDataLocation.of("classpath:/configdata/properties/");
327327
this.environment.setActiveProfiles("-dev");
328328
Profiles profiles = new Profiles(this.environment, this.environmentBinder, Collections.emptyList());
@@ -342,7 +342,7 @@ void resolveProfileSpecificWhenProfileStartsWithUnderscoreThrowsException() {
342342
}
343343

344344
@Test
345-
void resolveProfileSpecificWhenProfileEndsWithSymbolThrowsException() {
345+
void resolveProfileSpecificWhenProfileEndsWithDashThrowsException() {
346346
ConfigDataLocation location = ConfigDataLocation.of("classpath:/configdata/properties/");
347347
this.environment.setActiveProfiles("dev-");
348348
Profiles profiles = new Profiles(this.environment, this.environmentBinder, Collections.emptyList());
@@ -368,7 +368,7 @@ void resolveProfileSpecificWhenProfileContainsInvalidCharactersThrowsException()
368368
Profiles profiles = new Profiles(this.environment, this.environmentBinder, Collections.emptyList());
369369
assertThatIllegalStateException()
370370
.isThrownBy(() -> this.resolver.resolveProfileSpecific(this.context, location, profiles))
371-
.withMessageStartingWith("Invalid profile 'dev*test': must contain only letters or digits or '-' or '_'");
371+
.withMessageStartingWith("Invalid profile 'dev*test': must contain only letters, digits, '-', or '_'");
372372
}
373373

374374
private String filePath(String... components) {

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void shouldRegisterRuntimeHints() throws Exception {
6969
}
7070

7171
@Test
72-
void structuredLoggingJsonPropertiesRuntimeHintsRuntimeHintsIsRegistered() {
72+
void structuredLoggingJsonPropertiesRuntimeHintsIsRegistered() {
7373
assertThat(AotServices.factories().load(RuntimeHintsRegistrar.class))
7474
.anyMatch(StructuredLoggingJsonPropertiesRuntimeHints.class::isInstance);
7575
}

0 commit comments

Comments
 (0)