Browse Source

Fix typos in test code

This commit fixes typos in test class names, test method names, and
test variable names.

Closes gh-28807
pull/28850/head
Marc Wrobel 2 years ago committed by Sam Brannen
parent
commit
bd3499671c
  1. 2
      spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java
  2. 6
      spring-context/src/test/java/org/springframework/context/annotation/ParserStrategyUtilsTests.java
  3. 2
      spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibilityTests.java
  4. 2
      spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java
  5. 2
      spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java
  6. 8
      spring-expression/src/test/java/org/springframework/expression/spel/SetValueTests.java
  7. 4
      spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/MapDataSourceLookupTests.java
  8. 6
      spring-jdbc/src/test/java/org/springframework/jdbc/support/DatabaseStartupValidatorTests.java
  9. 2
      spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompHeaderAccessorTests.java
  10. 2
      spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2UnmarshallerTests.java
  11. 2
      spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/lookup/MapConnectionFactoryLookupUnitTests.java
  12. 4
      spring-test/src/test/java/org/springframework/test/context/junit/jupiter/AutowiredConfigurationErrorsIntegrationTests.java
  13. 2
      spring-test/src/test/java/org/springframework/test/context/support/ActiveProfilesUtilsTests.java
  14. 4
      spring-test/src/test/java/org/springframework/test/context/support/DirtiesContextTestExecutionListenerTests.java
  15. 6
      spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultControllerSpecTests.java
  16. 4
      spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingDataBindingIntegrationTests.java
  17. 2
      spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java
  18. 2
      spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoTests.java
  19. 2
      spring-webmvc/src/test/java/org/springframework/web/servlet/tags/UrlTagTests.java

2
spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java

@ -280,7 +280,7 @@ class BeanUtilsTests { @@ -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();

6
spring-context/src/test/java/org/springframework/context/annotation/ParserStrategyUtilsTests.java

@ -75,7 +75,7 @@ public class ParserStrategyUtilsTests { @@ -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 { @@ -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 { @@ -104,7 +104,7 @@ public class ParserStrategyUtilsTests {
}
@Test
public void instantiateClassWhenHasMutlipleConstructorsAndNotDefaultThrowsException() {
public void instantiateClassWhenHasMultipleConstructorsAndNotDefaultThrowsException() {
assertThatExceptionOfType(BeanInstantiationException.class).isThrownBy(() ->
instantiateClass(MultipleConstructorsWithNoDefault.class));
}

2
spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibiltyTests.java → spring-core/src/test/java/org/springframework/core/annotation/AnnotationBackCompatibilityTests.java

@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -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() {

2
spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java

@ -120,7 +120,7 @@ class AnnotationsScannerTests { @@ -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(

2
spring-core/src/test/java/org/springframework/core/env/StandardEnvironmentTests.java vendored

@ -242,7 +242,7 @@ public class StandardEnvironmentTests { @@ -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);

8
spring-expression/src/test/java/org/springframework/expression/spel/SetValueTests.java

@ -139,13 +139,13 @@ public class SetValueTests extends AbstractExpressionTests { @@ -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 { @@ -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);
}

4
spring-jdbc/src/test/java/org/springframework/jdbc/datasource/lookup/MapDataSourceLookupTests.java

@ -73,9 +73,9 @@ public class MapDataSourceLookupTests { @@ -73,9 +73,9 @@ public class MapDataSourceLookupTests {
@Test
public void addingDataSourcePermitsOverride() throws Exception {
Map<String, DataSource> 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

6
spring-jdbc/src/test/java/org/springframework/jdbc/support/DatabaseStartupValidatorTests.java

@ -80,7 +80,7 @@ class DatabaseStartupValidatorTests { @@ -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 { @@ -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 { @@ -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);

2
spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompHeaderAccessorTests.java

@ -70,7 +70,7 @@ public class StompHeaderAccessorTests { @@ -70,7 +70,7 @@ public class StompHeaderAccessorTests {
}
@Test
public void createWithUnubscribeNativeHeaders() {
public void createWithUnsubscribeNativeHeaders() {
MultiValueMap<String, String> extHeaders = new LinkedMultiValueMap<>();
extHeaders.add(StompHeaderAccessor.STOMP_ID_HEADER, "s1");

2
spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2UnmarshallerTests.java

@ -126,7 +126,7 @@ public class Jaxb2UnmarshallerTests extends AbstractUnmarshallerTests<Jaxb2Marsh @@ -126,7 +126,7 @@ public class Jaxb2UnmarshallerTests extends AbstractUnmarshallerTests<Jaxb2Marsh
@Test
@SuppressWarnings("unchecked")
public void unmarshalAnXmlReferingToAWrappedXmlElementDecl() throws Exception {
public void unmarshalAnXmlReferringToAWrappedXmlElementDecl() throws Exception {
// SPR-10714
unmarshaller = new Jaxb2Marshaller();
unmarshaller.setPackagesToScan(new String[] { "org.springframework.oxm.jaxb" });

2
spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/lookup/MapConnectionFactoryLookupUnitTests.java

@ -35,7 +35,7 @@ public class MapConnectionFactoryLookupUnitTests { @@ -35,7 +35,7 @@ public class MapConnectionFactoryLookupUnitTests {
private static final String CONNECTION_FACTORY_NAME = "connectionFactory";
@Test
public void getConnectionFactorysReturnsUnmodifiableMap() {
public void getConnectionFactoriesReturnsUnmodifiableMap() {
MapConnectionFactoryLookup lookup = new MapConnectionFactoryLookup();
Map<String, ConnectionFactory> connectionFactories = lookup.getConnectionFactories();

4
spring-test/src/test/java/org/springframework/test/context/junit/jupiter/AutowiredConfigurationErrorsIntegrationTests.java

@ -72,7 +72,7 @@ class AutowiredConfigurationErrorsIntegrationTests { @@ -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 { @@ -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,

2
spring-test/src/test/java/org/springframework/test/context/support/ActiveProfilesUtilsTests.java

@ -168,7 +168,7 @@ class ActiveProfilesUtilsTests extends AbstractContextConfigurationUtilsTests { @@ -168,7 +168,7 @@ class ActiveProfilesUtilsTests extends AbstractContextConfigurationUtilsTests {
* @since 4.0
*/
@Test
void resolveActiveProfilesWithOverridenInheritedResolver() {
void resolveActiveProfilesWithOverriddenInheritedResolver() {
assertResolvedProfiles(OverriddenInheritedFooActiveProfilesResolverTestCase.class, "bar");
}

4
spring-test/src/test/java/org/springframework/test/context/support/DirtiesContextTestExecutionListenerTests.java

@ -248,7 +248,7 @@ class DirtiesContextTestExecutionListenerTests { @@ -248,7 +248,7 @@ class DirtiesContextTestExecutionListenerTests {
@Test
void declaredViaMetaAnnotationWithOverriddenAttributes() throws Exception {
assertAfterClass(DirtiesContextViaMetaAnnotationWithOverridenAttributes.class);
assertAfterClass(DirtiesContextViaMetaAnnotationWithOverriddenAttributes.class);
}
}
@ -444,7 +444,7 @@ class DirtiesContextTestExecutionListenerTests { @@ -444,7 +444,7 @@ class DirtiesContextTestExecutionListenerTests {
}
@MetaDirtyWithOverrides(classMode = AFTER_CLASS, hierarchyMode = EXHAUSTIVE)
static class DirtiesContextViaMetaAnnotationWithOverridenAttributes {
static class DirtiesContextViaMetaAnnotationWithOverriddenAttributes {
void test() {
}

6
spring-test/src/test/java/org/springframework/test/web/reactive/server/DefaultControllerSpecTests.java

@ -75,7 +75,7 @@ public class DefaultControllerSpecTests { @@ -75,7 +75,7 @@ public class DefaultControllerSpecTests {
@Test
public void configurerConsumers() {
TestConsumer<ArgumentResolverConfigurer> argumentResolverConsumer = new TestConsumer<>();
TestConsumer<RequestedContentTypeResolverBuilder> contenTypeResolverConsumer = new TestConsumer<>();
TestConsumer<RequestedContentTypeResolverBuilder> contentTypeResolverConsumer = new TestConsumer<>();
TestConsumer<CorsRegistry> corsRegistryConsumer = new TestConsumer<>();
TestConsumer<FormatterRegistry> formatterConsumer = new TestConsumer<>();
TestConsumer<ServerCodecConfigurer> codecsConsumer = new TestConsumer<>();
@ -84,7 +84,7 @@ public class DefaultControllerSpecTests { @@ -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 { @@ -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();

4
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingDataBindingIntegrationTests.java

@ -110,8 +110,8 @@ class RequestMappingDataBindingIntegrationTests extends AbstractRequestMappingIn @@ -110,8 +110,8 @@ class RequestMappingDataBindingIntegrationTests extends AbstractRequestMappingIn
}
@ModelAttribute
public Mono<Foo> addFooAttribute(@PathVariable("id") Optional<Long> optiponalId) {
return optiponalId.map(id -> Mono.just(new Foo(id))).orElse(Mono.empty());
public Mono<Foo> addFooAttribute(@PathVariable("id") Optional<Long> optionalId) {
return optionalId.map(id -> Mono.just(new Foo(id))).orElse(Mono.empty());
}
@PostMapping("/foos/{id}")

2
spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java

@ -336,7 +336,7 @@ public class WebMvcConfigurationSupportTests { @@ -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);

2
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/RequestMappingInfoTests.java

@ -185,7 +185,7 @@ class RequestMappingInfoTests { @@ -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();

2
spring-webmvc/src/test/java/org/springframework/web/servlet/tags/UrlTagTests.java

@ -223,7 +223,7 @@ public class UrlTagTests extends AbstractTagTests { @@ -223,7 +223,7 @@ public class UrlTagTests extends AbstractTagTests {
}
@Test
public void createQueryStringOneParamForExsistingQueryString() throws JspException {
public void createQueryStringOneParamForExistingQueryString() throws JspException {
List<Param> params = new ArrayList<>();
Set<String> usedParams = new HashSet<>();

Loading…
Cancel
Save