From 82d8222f56361079daae64eec4056fe4d7ce6bc9 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 24 May 2024 18:10:03 -0700 Subject: [PATCH] Polish --- .../antora/AntoraAsciidocAttributesTests.java | 6 +-- .../DefaultGraphQlSchemaConditionTests.java | 4 +- .../pulsar/PulsarPropertiesTests.java | 40 +++++++++---------- .../devtools/MyContainersConfiguration.kt | 2 +- .../MyContainersConfiguration.kt | 2 +- .../analyzer/BindFailureAnalyzerTests.java | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/buildSrc/src/test/java/org/springframework/boot/build/antora/AntoraAsciidocAttributesTests.java b/buildSrc/src/test/java/org/springframework/boot/build/antora/AntoraAsciidocAttributesTests.java index d8be2cde060b..c197e3cefd40 100644 --- a/buildSrc/src/test/java/org/springframework/boot/build/antora/AntoraAsciidocAttributesTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/antora/AntoraAsciidocAttributesTests.java @@ -92,21 +92,21 @@ void versionNativeBuildTools() { } @Test - void urlArtifactReposiroryWhenRelease() { + void urlArtifactRepositoryWhenRelease() { AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.maven.apache.org/maven2"); } @Test - void urlArtifactReposiroryWhenMilestone() { + void urlArtifactRepositoryWhenMilestone() { AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.spring.io/milestone"); } @Test - void urlArtifactReposiroryWhenSnapshot() { + void urlArtifactRepositoryWhenSnapshot() { AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, null, mockDependencyVersions(), null); assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.spring.io/snapshot"); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/graphql/DefaultGraphQlSchemaConditionTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/graphql/DefaultGraphQlSchemaConditionTests.java index 7e54b9a1e9b6..e6b0ebdf75d0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/graphql/DefaultGraphQlSchemaConditionTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/graphql/DefaultGraphQlSchemaConditionTests.java @@ -54,7 +54,7 @@ void matchesWhenCustomizerIsDetected() { didMatch(context); assertThat(conditionReportMessage(context)).contains( "@ConditionalOnGraphQlSchema did not find schema files in locations 'classpath:graphql/missing/'") - .contains("@ConditionalOnGraphQlSchema found customizer myBuilderCuystomizer"); + .contains("@ConditionalOnGraphQlSchema found customizer myBuilderCustomizer"); }); } @@ -98,7 +98,7 @@ String success() { static class CustomCustomizerConfiguration { @Bean - GraphQlSourceBuilderCustomizer myBuilderCuystomizer() { + GraphQlSourceBuilderCustomizer myBuilderCustomizer() { return (builder) -> { }; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/pulsar/PulsarPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/pulsar/PulsarPropertiesTests.java index 1cdc825dff44..53e90a2b954c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/pulsar/PulsarPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/pulsar/PulsarPropertiesTests.java @@ -55,7 +55,7 @@ */ class PulsarPropertiesTests { - private PulsarProperties bindPropeties(Map map) { + private PulsarProperties bindProperties(Map map) { return new Binder(new MapConfigurationPropertySource(map)).bind("spring.pulsar", PulsarProperties.class).get(); } @@ -69,7 +69,7 @@ void bind() { map.put("spring.pulsar.client.operation-timeout", "1s"); map.put("spring.pulsar.client.lookup-timeout", "2s"); map.put("spring.pulsar.client.connection-timeout", "12s"); - PulsarProperties.Client properties = bindPropeties(map).getClient(); + PulsarProperties.Client properties = bindProperties(map).getClient(); assertThat(properties.getServiceUrl()).isEqualTo("my-service-url"); assertThat(properties.getOperationTimeout()).isEqualTo(Duration.ofMillis(1000)); assertThat(properties.getLookupTimeout()).isEqualTo(Duration.ofMillis(2000)); @@ -81,7 +81,7 @@ void bindAuthentication() { Map map = new HashMap<>(); map.put("spring.pulsar.client.authentication.plugin-class-name", "com.example.MyAuth"); map.put("spring.pulsar.client.authentication.param.token", "1234"); - PulsarProperties.Client properties = bindPropeties(map).getClient(); + PulsarProperties.Client properties = bindProperties(map).getClient(); assertThat(properties.getAuthentication().getPluginClassName()).isEqualTo("com.example.MyAuth"); assertThat(properties.getAuthentication().getParam()).containsEntry("token", "1234"); } @@ -101,7 +101,7 @@ void bindFailover() { map.put("spring.pulsar.client.failover.backup-clusters[1].authentication.plugin-class-name", "com.example.MyAuth2"); map.put("spring.pulsar.client.failover.backup-clusters[1].authentication.param.token", "5678"); - PulsarProperties.Client properties = bindPropeties(map).getClient(); + PulsarProperties.Client properties = bindProperties(map).getClient(); Failover failoverProperties = properties.getFailover(); List backupClusters = properties.getFailover().getBackupClusters(); assertThat(properties.getServiceUrl()).isEqualTo("my-service-url"); @@ -132,7 +132,7 @@ void bind() { map.put("spring.pulsar.admin.connection-timeout", "12s"); map.put("spring.pulsar.admin.read-timeout", "13s"); map.put("spring.pulsar.admin.request-timeout", "14s"); - PulsarProperties.Admin properties = bindPropeties(map).getAdmin(); + PulsarProperties.Admin properties = bindProperties(map).getAdmin(); assertThat(properties.getServiceUrl()).isEqualTo("my-service-url"); assertThat(properties.getConnectionTimeout()).isEqualTo(Duration.ofSeconds(12)); assertThat(properties.getReadTimeout()).isEqualTo(Duration.ofSeconds(13)); @@ -144,7 +144,7 @@ void bindAuthentication() { Map map = new HashMap<>(); map.put("spring.pulsar.admin.authentication.plugin-class-name", this.authPluginClassName); map.put("spring.pulsar.admin.authentication.param.token", this.authToken); - PulsarProperties.Admin properties = bindPropeties(map).getAdmin(); + PulsarProperties.Admin properties = bindProperties(map).getAdmin(); assertThat(properties.getAuthentication().getPluginClassName()).isEqualTo(this.authPluginClassName); assertThat(properties.getAuthentication().getParam()).containsEntry("token", this.authToken); } @@ -166,7 +166,7 @@ void bindWhenTypeMappingsWithTopicsOnly() { map.put("spring.pulsar.defaults.type-mappings[0].topic-name", "foo-topic"); map.put("spring.pulsar.defaults.type-mappings[1].message-type", String.class.getName()); map.put("spring.pulsar.defaults.type-mappings[1].topic-name", "string-topic"); - PulsarProperties.Defaults properties = bindPropeties(map).getDefaults(); + PulsarProperties.Defaults properties = bindProperties(map).getDefaults(); TypeMapping expectedTopic1 = new TypeMapping(TestMessage.class, "foo-topic", null); TypeMapping expectedTopic2 = new TypeMapping(String.class, "string-topic", null); assertThat(properties.getTypeMappings()).containsExactly(expectedTopic1, expectedTopic2); @@ -177,7 +177,7 @@ void bindWhenTypeMappingsWithSchemaOnly() { Map map = new HashMap<>(); map.put("spring.pulsar.defaults.type-mappings[0].message-type", TestMessage.class.getName()); map.put("spring.pulsar.defaults.type-mappings[0].schema-info.schema-type", "JSON"); - PulsarProperties.Defaults properties = bindPropeties(map).getDefaults(); + PulsarProperties.Defaults properties = bindProperties(map).getDefaults(); TypeMapping expected = new TypeMapping(TestMessage.class, null, new SchemaInfo(SchemaType.JSON, null)); assertThat(properties.getTypeMappings()).containsExactly(expected); } @@ -188,7 +188,7 @@ void bindWhenTypeMappingsWithTopicAndSchema() { map.put("spring.pulsar.defaults.type-mappings[0].message-type", TestMessage.class.getName()); map.put("spring.pulsar.defaults.type-mappings[0].topic-name", "foo-topic"); map.put("spring.pulsar.defaults.type-mappings[0].schema-info.schema-type", "JSON"); - PulsarProperties.Defaults properties = bindPropeties(map).getDefaults(); + PulsarProperties.Defaults properties = bindProperties(map).getDefaults(); TypeMapping expected = new TypeMapping(TestMessage.class, "foo-topic", new SchemaInfo(SchemaType.JSON, null)); assertThat(properties.getTypeMappings()).containsExactly(expected); @@ -200,7 +200,7 @@ void bindWhenTypeMappingsWithKeyValueSchema() { map.put("spring.pulsar.defaults.type-mappings[0].message-type", TestMessage.class.getName()); map.put("spring.pulsar.defaults.type-mappings[0].schema-info.schema-type", "KEY_VALUE"); map.put("spring.pulsar.defaults.type-mappings[0].schema-info.message-key-type", String.class.getName()); - PulsarProperties.Defaults properties = bindPropeties(map).getDefaults(); + PulsarProperties.Defaults properties = bindProperties(map).getDefaults(); TypeMapping expected = new TypeMapping(TestMessage.class, null, new SchemaInfo(SchemaType.KEY_VALUE, String.class)); assertThat(properties.getTypeMappings()).containsExactly(expected); @@ -211,7 +211,7 @@ void bindWhenNoSchemaThrowsException() { Map map = new HashMap<>(); map.put("spring.pulsar.defaults.type-mappings[0].message-type", TestMessage.class.getName()); map.put("spring.pulsar.defaults.type-mappings[0].schema-info.message-key-type", String.class.getName()); - assertThatExceptionOfType(BindException.class).isThrownBy(() -> bindPropeties(map)) + assertThatExceptionOfType(BindException.class).isThrownBy(() -> bindProperties(map)) .havingRootCause() .withMessageContaining("schemaType must not be null"); } @@ -221,7 +221,7 @@ void bindWhenSchemaTypeNoneThrowsException() { Map map = new HashMap<>(); map.put("spring.pulsar.defaults.type-mappings[0].message-type", TestMessage.class.getName()); map.put("spring.pulsar.defaults.type-mappings[0].schema-info.schema-type", "NONE"); - assertThatExceptionOfType(BindException.class).isThrownBy(() -> bindPropeties(map)) + assertThatExceptionOfType(BindException.class).isThrownBy(() -> bindProperties(map)) .havingRootCause() .withMessageContaining("schemaType 'NONE' not supported"); } @@ -232,7 +232,7 @@ void bindWhenMessageKeyTypeSetOnNonKeyValueSchemaThrowsException() { map.put("spring.pulsar.defaults.type-mappings[0].message-type", TestMessage.class.getName()); map.put("spring.pulsar.defaults.type-mappings[0].schema-info.schema-type", "JSON"); map.put("spring.pulsar.defaults.type-mappings[0].schema-info.message-key-type", String.class.getName()); - assertThatExceptionOfType(BindException.class).isThrownBy(() -> bindPropeties(map)) + assertThatExceptionOfType(BindException.class).isThrownBy(() -> bindProperties(map)) .havingRootCause() .withMessageContaining("messageKeyType can only be set when schemaType is KEY_VALUE"); } @@ -259,7 +259,7 @@ void bind() { props.put("spring.pulsar.function.fail-fast", "false"); props.put("spring.pulsar.function.propagate-failures", "false"); props.put("spring.pulsar.function.propagate-stop-failures", "true"); - PulsarProperties.Function properties = bindPropeties(props).getFunction(); + PulsarProperties.Function properties = bindProperties(props).getFunction(); assertThat(properties.isFailFast()).isFalse(); assertThat(properties.isPropagateFailures()).isFalse(); assertThat(properties.isPropagateStopFailures()).isTrue(); @@ -285,7 +285,7 @@ void bind() { map.put("spring.pulsar.producer.cache.expire-after-access", "2s"); map.put("spring.pulsar.producer.cache.maximum-size", "3"); map.put("spring.pulsar.producer.cache.initial-capacity", "5"); - PulsarProperties.Producer properties = bindPropeties(map).getProducer(); + PulsarProperties.Producer properties = bindProperties(map).getProducer(); assertThat(properties.getName()).isEqualTo("my-producer"); assertThat(properties.getTopicName()).isEqualTo("my-topic"); assertThat(properties.getSendTimeout()).isEqualTo(Duration.ofSeconds(2)); @@ -323,7 +323,7 @@ void bind() { map.put("spring.pulsar.consumer.dead-letter-policy.dead-letter-topic", "my-dlt-topic"); map.put("spring.pulsar.consumer.dead-letter-policy.initial-subscription-name", "my-initial-subscription"); map.put("spring.pulsar.consumer.retry-enable", "true"); - PulsarProperties.Consumer properties = bindPropeties(map).getConsumer(); + PulsarProperties.Consumer properties = bindProperties(map).getConsumer(); assertThat(properties.getName()).isEqualTo("my-consumer"); assertThat(properties.getSubscription()).satisfies((subscription) -> { assertThat(subscription.getName()).isEqualTo("my-subscription"); @@ -355,7 +355,7 @@ void bind() { Map map = new HashMap<>(); map.put("spring.pulsar.listener.schema-type", "avro"); map.put("spring.pulsar.listener.observation-enabled", "true"); - PulsarProperties.Listener properties = bindPropeties(map).getListener(); + PulsarProperties.Listener properties = bindProperties(map).getListener(); assertThat(properties.getSchemaType()).isEqualTo(SchemaType.AVRO); assertThat(properties.isObservationEnabled()).isTrue(); } @@ -373,7 +373,7 @@ void bind() { map.put("spring.pulsar.reader.subscription-name", "my-subscription"); map.put("spring.pulsar.reader.subscription-role-prefix", "sub-role"); map.put("spring.pulsar.reader.read-compacted", "true"); - PulsarProperties.Reader properties = bindPropeties(map).getReader(); + PulsarProperties.Reader properties = bindProperties(map).getReader(); assertThat(properties.getName()).isEqualTo("my-reader"); assertThat(properties.getTopics()).containsExactly("my-topic"); assertThat(properties.getSubscriptionName()).isEqualTo("my-subscription"); @@ -390,7 +390,7 @@ class TemplateProperties { void bind() { Map map = new HashMap<>(); map.put("spring.pulsar.template.observations-enabled", "true"); - PulsarProperties.Template properties = bindPropeties(map).getTemplate(); + PulsarProperties.Template properties = bindProperties(map).getTemplate(); assertThat(properties.isObservationsEnabled()).isTrue(); } @@ -403,7 +403,7 @@ class TransactionProperties { void bind() { Map map = new HashMap<>(); map.put("spring.pulsar.transaction.enabled", "true"); - PulsarProperties.Transaction properties = bindPropeties(map).getTransaction(); + PulsarProperties.Transaction properties = bindProperties(map).getTransaction(); assertThat(properties.isEnabled()).isTrue(); } diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/devtools/MyContainersConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/devtools/MyContainersConfiguration.kt index 8837947959f0..44a21e69418d 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/devtools/MyContainersConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/devtools/MyContainersConfiguration.kt @@ -27,7 +27,7 @@ class MyContainersConfiguration { @Bean @RestartScope @ServiceConnection - fun monogDbContainer(): MongoDBContainer { + fun mongoDbContainer(): MongoDBContainer { return MongoDBContainer("mongo:5.0") } diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/dynamicproperties/MyContainersConfiguration.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/dynamicproperties/MyContainersConfiguration.kt index 5ee593e46c24..04959303fcad 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/dynamicproperties/MyContainersConfiguration.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testcontainers/atdevelopmenttime/dynamicproperties/MyContainersConfiguration.kt @@ -25,7 +25,7 @@ import org.testcontainers.containers.MongoDBContainer class MyContainersConfiguration { @Bean - fun monogDbContainer(properties: DynamicPropertyRegistry): MongoDBContainer { + fun mongoDbContainer(properties: DynamicPropertyRegistry): MongoDBContainer { var container = MongoDBContainer("mongo:5.0") properties.add("spring.data.mongodb.host", container::getHost) properties.add("spring.data.mongodb.port", container::getFirstMappedPort) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java index 5d03732ff9e0..60a031cd9b3c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java @@ -100,7 +100,7 @@ void bindExceptionDueToMapConversionFailure() { } @Test - void bindExceptionWithSupressedMissingParametersException() { + void bindExceptionWithSuppressedMissingParametersException() { BeanCreationException failure = createFailure(GenericFailureConfiguration.class, "test.foo.value=alpha"); failure.addSuppressed(new IllegalStateException( "Missing parameter names. Ensure that the compiler uses the '-parameters' flag"));