From bd3499671c7067c176898a02f70b9cdd78628911 Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Tue, 12 Jul 2022 20:11:17 +0200 Subject: [PATCH] Fix typos in test code This commit fixes typos in test class names, test method names, and test variable names. Closes gh-28807 --- .../java/org/springframework/beans/BeanUtilsTests.java | 2 +- .../context/annotation/ParserStrategyUtilsTests.java | 6 +++--- ...tyTests.java => AnnotationBackCompatibilityTests.java} | 2 +- .../core/annotation/AnnotationsScannerTests.java | 2 +- .../core/env/StandardEnvironmentTests.java | 2 +- .../springframework/expression/spel/SetValueTests.java | 8 ++++---- .../jdbc/datasource/lookup/MapDataSourceLookupTests.java | 4 ++-- .../jdbc/support/DatabaseStartupValidatorTests.java | 6 +++--- .../messaging/simp/stomp/StompHeaderAccessorTests.java | 2 +- .../springframework/oxm/jaxb/Jaxb2UnmarshallerTests.java | 2 +- .../lookup/MapConnectionFactoryLookupUnitTests.java | 2 +- .../AutowiredConfigurationErrorsIntegrationTests.java | 4 ++-- .../test/context/support/ActiveProfilesUtilsTests.java | 2 +- .../support/DirtiesContextTestExecutionListenerTests.java | 4 ++-- .../web/reactive/server/DefaultControllerSpecTests.java | 6 +++--- .../RequestMappingDataBindingIntegrationTests.java | 4 ++-- .../annotation/WebMvcConfigurationSupportTests.java | 2 +- .../web/servlet/mvc/method/RequestMappingInfoTests.java | 2 +- .../org/springframework/web/servlet/tags/UrlTagTests.java | 2 +- 19 files changed, 32 insertions(+), 32 deletions(-) rename spring-core/src/test/java/org/springframework/core/annotation/{AnnotationBackCompatibiltyTests.java => AnnotationBackCompatibilityTests.java} (98%) diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java index 711189cdf1..7510c8bc27 100644 --- a/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java @@ -280,7 +280,7 @@ class BeanUtilsTests { * {@code Number} can NOT be copied to {@code Integer}. */ @Test - void copyPropertiesDoesNotCopyeFromSuperTypeToSubType() { + void copyPropertiesDoesNotCopyFromSuperTypeToSubType() { NumberHolder numberHolder = new NumberHolder(); numberHolder.setNumber(Integer.valueOf(42)); IntegerHolder integerHolder = new IntegerHolder(); diff --git a/spring-context/src/test/java/org/springframework/context/annotation/ParserStrategyUtilsTests.java b/spring-context/src/test/java/org/springframework/context/annotation/ParserStrategyUtilsTests.java index 87663ede08..7acc0c7d20 100644 --- a/spring-context/src/test/java/org/springframework/context/annotation/ParserStrategyUtilsTests.java +++ b/spring-context/src/test/java/org/springframework/context/annotation/ParserStrategyUtilsTests.java @@ -75,7 +75,7 @@ public class ParserStrategyUtilsTests { } @Test - public void instantiateClassWhenHasSingleContructorInjectsParams() { + public void instantiateClassWhenHasSingleConstructorInjectsParams() { ArgsConstructor instance = instantiateClass(ArgsConstructor.class); assertThat(instance.environment).isSameAs(this.environment); assertThat(instance.beanFactory).isSameAs(this.registry); @@ -84,7 +84,7 @@ public class ParserStrategyUtilsTests { } @Test - public void instantiateClassWhenHasSingleContructorAndAwareInjectsParamsAndCallsAware() { + public void instantiateClassWhenHasSingleConstructorAndAwareInjectsParamsAndCallsAware() { ArgsConstructorAndAware instance = instantiateClass(ArgsConstructorAndAware.class); assertThat(instance.environment).isSameAs(this.environment); assertThat(instance.setEnvironment).isSameAs(this.environment); @@ -104,7 +104,7 @@ public class ParserStrategyUtilsTests { } @Test - public void instantiateClassWhenHasMutlipleConstructorsAndNotDefaultThrowsException() { + public void instantiateClassWhenHasMultipleConstructorsAndNotDefaultThrowsException() { assertThatExceptionOfType(BeanInstantiationException.class).isThrownBy(() -> instantiateClass(MultipleConstructorsWithNoDefault.class)); } diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibiltyTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibilityTests.java similarity index 98% rename from spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibiltyTests.java rename to spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibilityTests.java index 80e137c44e..582488fa5b 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibiltyTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibilityTests.java @@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Phillip Webb * @since 5.2 */ -class AnnotationBackCompatibiltyTests { +class AnnotationBackCompatibilityTests { @Test void multiplRoutesToMetaAnnotation() { diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java index 83518d9b38..1ef9cd9b00 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java @@ -120,7 +120,7 @@ class AnnotationsScannerTests { } @Test - void inheritedAnnotationsStrategyOnClassWhenHasAnnotationOnBothClassesIncudesOnlyOne() { + void inheritedAnnotationsStrategyOnClassWhenHasAnnotationOnBothClassesIncludesOnlyOne() { Class source = WithSingleSuperclassAndDoubleInherited.class; assertThat(Arrays.stream(source.getAnnotations()).map( Annotation::annotationType).map(Class::getName)).containsExactly( diff --git a/spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java b/spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java index e45f8b189f..e711924d1d 100644 --- a/spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java +++ b/spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java @@ -242,7 +242,7 @@ public class StandardEnvironmentTests { } @Test - void getActiveProfiles_fromSystemProperties_withMulitpleProfiles_withWhitespace() { + void getActiveProfiles_fromSystemProperties_withMultipleProfiles_withWhitespace() { System.setProperty(ACTIVE_PROFILES_PROPERTY_NAME, " bar , baz "); // notice whitespace assertThat(environment.getActiveProfiles()).contains("bar", "baz"); System.clearProperty(ACTIVE_PROFILES_PROPERTY_NAME); diff --git a/spring-expression/src/test/java/org/springframework/expression/spel/SetValueTests.java b/spring-expression/src/test/java/org/springframework/expression/spel/SetValueTests.java index c79d286eea..08dadcbf34 100644 --- a/spring-expression/src/test/java/org/springframework/expression/spel/SetValueTests.java +++ b/spring-expression/src/test/java/org/springframework/expression/spel/SetValueTests.java @@ -139,13 +139,13 @@ public class SetValueTests extends AbstractExpressionTests { } @Test - public void testSetGenericListElementValueTypeCoersion() { + public void testSetGenericListElementValueTypeCoercion() { // TODO currently failing since setValue does a getValue and "Wien" string != PlaceOfBirth - check with andy setValue("placesLivedList[0]", "Wien"); } @Test - public void testSetGenericListElementValueTypeCoersionOK() { + public void testSetGenericListElementValueTypeCoercionOK() { setValue("booleanList[0]", "true", Boolean.TRUE); } @@ -171,12 +171,12 @@ public class SetValueTests extends AbstractExpressionTests { } @Test - public void testSetPropertyTypeCoersion() { + public void testSetPropertyTypeCoercion() { setValue("publicBoolean", "true", Boolean.TRUE); } @Test - public void testSetPropertyTypeCoersionThroughSetter() { + public void testSetPropertyTypeCoercionThroughSetter() { setValue("SomeProperty", "true", Boolean.TRUE); } diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/MapDataSourceLookupTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/MapDataSourceLookupTests.java index 39b7b6dc92..6259c89e8e 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/MapDataSourceLookupTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/MapDataSourceLookupTests.java @@ -73,9 +73,9 @@ public class MapDataSourceLookupTests { @Test public void addingDataSourcePermitsOverride() throws Exception { Map dataSources = new HashMap<>(); - StubDataSource overridenDataSource = new StubDataSource(); + StubDataSource overriddenDataSource = new StubDataSource(); StubDataSource expectedDataSource = new StubDataSource(); - dataSources.put(DATA_SOURCE_NAME, overridenDataSource); + dataSources.put(DATA_SOURCE_NAME, overriddenDataSource); MapDataSourceLookup lookup = new MapDataSourceLookup(); lookup.setDataSources(dataSources); lookup.addDataSource(DATA_SOURCE_NAME, expectedDataSource); // must override existing entry diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/support/DatabaseStartupValidatorTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/support/DatabaseStartupValidatorTests.java index 498d75473f..f10f949dc6 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/support/DatabaseStartupValidatorTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/support/DatabaseStartupValidatorTests.java @@ -80,7 +80,7 @@ class DatabaseStartupValidatorTests { } @Test - void shouldCallValidatonTwiceWhenNotValid() throws Exception { + void shouldCallValidationTwiceWhenNotValid() throws Exception { given(connection.isValid(1)).willReturn(false, true); validator.afterPropertiesSet(); @@ -90,7 +90,7 @@ class DatabaseStartupValidatorTests { } @Test - void shouldCallValidatonTwiceInCaseOfException() throws Exception { + void shouldCallValidationTwiceInCaseOfException() throws Exception { given(connection.isValid(1)).willThrow(new SQLException("Test")).willReturn(true); validator.afterPropertiesSet(); @@ -118,7 +118,7 @@ class DatabaseStartupValidatorTests { @Test @SuppressWarnings("deprecation") - void shouldExecuteValidatonTwiceOnError() throws Exception { + void shouldExecuteValidationTwiceOnError() throws Exception { String validationQuery = "SELECT NOW() FROM DUAL"; Statement statement = mock(Statement.class); given(connection.createStatement()).willReturn(statement); diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompHeaderAccessorTests.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompHeaderAccessorTests.java index 49915dbd01..c004e675ea 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompHeaderAccessorTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompHeaderAccessorTests.java @@ -70,7 +70,7 @@ public class StompHeaderAccessorTests { } @Test - public void createWithUnubscribeNativeHeaders() { + public void createWithUnsubscribeNativeHeaders() { MultiValueMap extHeaders = new LinkedMultiValueMap<>(); extHeaders.add(StompHeaderAccessor.STOMP_ID_HEADER, "s1"); diff --git a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2UnmarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2UnmarshallerTests.java index 4a4b9c9998..84f8c43ff9 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2UnmarshallerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2UnmarshallerTests.java @@ -126,7 +126,7 @@ public class Jaxb2UnmarshallerTests extends AbstractUnmarshallerTests connectionFactories = lookup.getConnectionFactories(); diff --git a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/AutowiredConfigurationErrorsIntegrationTests.java b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/AutowiredConfigurationErrorsIntegrationTests.java index fc877f12a7..919e0b841b 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/AutowiredConfigurationErrorsIntegrationTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/AutowiredConfigurationErrorsIntegrationTests.java @@ -72,7 +72,7 @@ class AutowiredConfigurationErrorsIntegrationTests { AutowiredRepeatedTestMethod.class, AutowiredParameterizedTestMethod.class }) - void autowiredTestMethodsTestTemplateMethodsAndLifecyleMethods(Class testClass) { + void autowiredTestMethodsTestTemplateMethodsAndLifecycleMethods(Class testClass) { testEventsFor(testClass) .assertStatistics(stats -> stats.started(1).succeeded(0).failed(1)) .assertThatEvents().haveExactly(1, @@ -111,7 +111,7 @@ class AutowiredConfigurationErrorsIntegrationTests { NonStaticAutowiredBeforeAllMethod.class, NonStaticAutowiredAfterAllMethod.class }) - void autowiredNonStaticClassLevelLifecyleMethods(Class testClass) { + void autowiredNonStaticClassLevelLifecycleMethods(Class testClass) { containerEventsFor(testClass) .assertStatistics(stats -> stats.started(2).succeeded(1).failed(1)) .assertThatEvents().haveExactly(1, diff --git a/spring-test/src/test/java/org/springframework/test/context/support/ActiveProfilesUtilsTests.java b/spring-test/src/test/java/org/springframework/test/context/support/ActiveProfilesUtilsTests.java index fab23ae19d..e74e75534a 100644 --- a/spring-test/src/test/java/org/springframework/test/context/support/ActiveProfilesUtilsTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/support/ActiveProfilesUtilsTests.java @@ -168,7 +168,7 @@ class ActiveProfilesUtilsTests extends AbstractContextConfigurationUtilsTests { * @since 4.0 */ @Test - void resolveActiveProfilesWithOverridenInheritedResolver() { + void resolveActiveProfilesWithOverriddenInheritedResolver() { assertResolvedProfiles(OverriddenInheritedFooActiveProfilesResolverTestCase.class, "bar"); } diff --git a/spring-test/src/test/java/org/springframework/test/context/support/DirtiesContextTestExecutionListenerTests.java b/spring-test/src/test/java/org/springframework/test/context/support/DirtiesContextTestExecutionListenerTests.java index f79dfd46a1..473b886583 100644 --- a/spring-test/src/test/java/org/springframework/test/context/support/DirtiesContextTestExecutionListenerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/support/DirtiesContextTestExecutionListenerTests.java @@ -248,7 +248,7 @@ class DirtiesContextTestExecutionListenerTests { @Test void declaredViaMetaAnnotationWithOverriddenAttributes() throws Exception { - assertAfterClass(DirtiesContextViaMetaAnnotationWithOverridenAttributes.class); + assertAfterClass(DirtiesContextViaMetaAnnotationWithOverriddenAttributes.class); } } @@ -444,7 +444,7 @@ class DirtiesContextTestExecutionListenerTests { } @MetaDirtyWithOverrides(classMode = AFTER_CLASS, hierarchyMode = EXHAUSTIVE) - static class DirtiesContextViaMetaAnnotationWithOverridenAttributes { + static class DirtiesContextViaMetaAnnotationWithOverriddenAttributes { void test() { } diff --git a/spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultControllerSpecTests.java b/spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultControllerSpecTests.java index 4613a49f64..3a7544011d 100644 --- a/spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultControllerSpecTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultControllerSpecTests.java @@ -75,7 +75,7 @@ public class DefaultControllerSpecTests { @Test public void configurerConsumers() { TestConsumer argumentResolverConsumer = new TestConsumer<>(); - TestConsumer contenTypeResolverConsumer = new TestConsumer<>(); + TestConsumer contentTypeResolverConsumer = new TestConsumer<>(); TestConsumer corsRegistryConsumer = new TestConsumer<>(); TestConsumer formatterConsumer = new TestConsumer<>(); TestConsumer codecsConsumer = new TestConsumer<>(); @@ -84,7 +84,7 @@ public class DefaultControllerSpecTests { new DefaultControllerSpec(new MyController()) .argumentResolvers(argumentResolverConsumer) - .contentTypeResolver(contenTypeResolverConsumer) + .contentTypeResolver(contentTypeResolverConsumer) .corsMappings(corsRegistryConsumer) .formatters(formatterConsumer) .httpMessageCodecs(codecsConsumer) @@ -93,7 +93,7 @@ public class DefaultControllerSpecTests { .build(); assertThat(argumentResolverConsumer.getValue()).isNotNull(); - assertThat(contenTypeResolverConsumer.getValue()).isNotNull(); + assertThat(contentTypeResolverConsumer.getValue()).isNotNull(); assertThat(corsRegistryConsumer.getValue()).isNotNull(); assertThat(formatterConsumer.getValue()).isNotNull(); assertThat(codecsConsumer.getValue()).isNotNull(); diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingDataBindingIntegrationTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingDataBindingIntegrationTests.java index 8cce6adcec..8608a2f329 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingDataBindingIntegrationTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingDataBindingIntegrationTests.java @@ -110,8 +110,8 @@ class RequestMappingDataBindingIntegrationTests extends AbstractRequestMappingIn } @ModelAttribute - public Mono addFooAttribute(@PathVariable("id") Optional optiponalId) { - return optiponalId.map(id -> Mono.just(new Foo(id))).orElse(Mono.empty()); + public Mono addFooAttribute(@PathVariable("id") Optional optionalId) { + return optionalId.map(id -> Mono.just(new Foo(id))).orElse(Mono.empty()); } @PostMapping("/foos/{id}") diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java index dad6504f9a..78271194ff 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java @@ -336,7 +336,7 @@ public class WebMvcConfigurationSupportTests { } @Test - public void defaultThemeResolverfiguration() { + public void defaultThemeResolverConfiguration() { ApplicationContext context = initContext(WebConfig.class); ThemeResolver themeResolver = context.getBean(THEME_RESOLVER_BEAN_NAME, ThemeResolver.class); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoTests.java index 985ed04568..97597738f9 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoTests.java @@ -185,7 +185,7 @@ class RequestMappingInfoTests { } @Test - void compareToWithImpicitVsExplicitHttpMethodDeclaration() { + void compareToWithImplicitVsExplicitHttpMethodDeclaration() { RequestMappingInfo noMethods = RequestMappingInfo.paths().build(); RequestMappingInfo oneMethod = RequestMappingInfo.paths().methods(GET).build(); RequestMappingInfo oneMethodOneParam = RequestMappingInfo.paths().methods(GET).params("foo").build(); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/UrlTagTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/UrlTagTests.java index 1b84cd2204..b013484ea7 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/UrlTagTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/tags/UrlTagTests.java @@ -223,7 +223,7 @@ public class UrlTagTests extends AbstractTagTests { } @Test - public void createQueryStringOneParamForExsistingQueryString() throws JspException { + public void createQueryStringOneParamForExistingQueryString() throws JspException { List params = new ArrayList<>(); Set usedParams = new HashSet<>();