Skip to content

Fix typos in test code #28807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void copyPropertiesHonorsGenericTypeMatchesForUpperBoundedWildcard() {
* {@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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void generatedCodeWhenSingleArgument() {
}

@Test
void generateCodeWhenMulitpleArguments() {
void generateCodeWhenMultipleArguments() {
Method method = ReflectionUtils.findMethod(UnambiguousMethods.class, "three",
String.class, Integer.class, Boolean.class);
AutowiredArgumentsCodeGenerator generator = new AutowiredArgumentsCodeGenerator(
Expand All @@ -62,7 +62,7 @@ void generateCodeWhenMulitpleArguments() {
}

@Test
void generateCodeWhenMulitpleArgumentsWithOffset() {
void generateCodeWhenMultipleArgumentsWithOffset() {
Constructor<?> constructor = Outer.Nested.class.getDeclaredConstructors()[0];
AutowiredArgumentsCodeGenerator generator = new AutowiredArgumentsCodeGenerator(
Outer.Nested.class, constructor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void resolveNonRequiredWhenNoSuchBeanReturnsNull() {
}

@Test
void resolveRequiredWithMultipleDependencesReturnsValue() {
void resolveRequiredWithMultipleDependenciesReturnsValue() {
Environment environment = mock(Environment.class);
this.beanFactory.registerSingleton("test", "testValue");
this.beanFactory.registerSingleton("environment", environment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void getBeanDefinitionMethodGeneratorAddsContributionsFromProcessors() {
}

@Test
void getBeanDefinitionMethodGeneratorWhenRegisteredBeanIsAotProcessorFilteresBean() {
void getBeanDefinitionMethodGeneratorWhenRegisteredBeanIsAotProcessorFilteredBean() {
MockSpringFactoriesLoader springFactoriesLoader = new MockSpringFactoriesLoader();
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
beanFactory.registerBeanDefinition("test1", BeanDefinitionBuilder
Expand All @@ -127,7 +127,7 @@ void getBeanDefinitionMethodGeneratorWhenRegisteredBeanIsAotProcessorFilteresBea
}

@Test
void getBeanDefinitionMethodGeneratorWhenRegisteredBeanIsAotProcessorAndFilteresBeanBeanRegistrationExcludeFilterDoesNotFilterBean() {
void getBeanDefinitionMethodGeneratorWhenRegisteredBeanIsAotProcessorAndFilteredBeanBeanRegistrationExcludeFilterDoesNotFilterBean() {
MockSpringFactoriesLoader springFactoriesLoader = new MockSpringFactoriesLoader();
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
beanFactory.registerBeanDefinition("test", BeanDefinitionBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void instantiateClassWhenHasNoArgsConstructorCallsAware() {
}

@Test
public void instantiateClassWhenHasSingleContructorInjectsParams() {
public void instantiateClassWhenHasSingleConstructorInjectsParams() {
ArgsConstructor instance = instantiateClass(ArgsConstructor.class);
assertThat(instance.environment).isSameAs(this.environment);
assertThat(instance.beanFactory).isSameAs(this.registry);
Expand All @@ -84,7 +84,7 @@ public void instantiateClassWhenHasSingleContructorInjectsParams() {
}

@Test
public void instantiateClassWhenHasSingleContructorAndAwareInjectsParamsAndCallsAware() {
public void instantiateClassWhenHasSingleConstructorAndAwareInjectsParamsAndCallsAware() {
ArgsConstructorAndAware instance = instantiateClass(ArgsConstructorAndAware.class);
assertThat(instance.environment).isSameAs(this.environment);
assertThat(instance.setEnvironment).isSameAs(this.environment);
Expand All @@ -104,7 +104,7 @@ public void instantiateClassWhenHasMultipleConstructorsUsesNoArgsConstructor() {
}

@Test
public void instantiateClassWhenHasMutlipleConstructorsAndNotDefaultThrowsException() {
public void instantiateClassWhenHasMultipleConstructorsAndNotDefaultThrowsException() {
assertThatExceptionOfType(BeanInstantiationException.class).isThrownBy(() ->
instantiateClass(MultipleConstructorsWithNoDefault.class));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void setup() throws Exception {
}

@Test
void classGetConstructorShouldMatchInstrospectPublicConstructorsHint() {
void classGetConstructorShouldMatchIntrospectPublicConstructorsHint() {
hints.reflection().registerType(String.class, typeHint -> typeHint.withMembers(MemberCategory.INTROSPECT_PUBLIC_CONSTRUCTORS));
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETCONSTRUCTOR, this.stringGetConstructor);
}
Expand All @@ -150,7 +150,7 @@ void classGetConstructorShouldMatchInvokeDeclaredConstructorsHint() {
}

@Test
void classGetConstructorShouldMatchInstrospectConstructorHint() {
void classGetConstructorShouldMatchIntrospectConstructorHint() {
hints.reflection().registerType(String.class, typeHint -> typeHint.withConstructor(Collections.emptyList(),
constructorHint -> constructorHint.setModes(ExecutableMode.INTROSPECT)));
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETCONSTRUCTOR, this.stringGetConstructor);
Expand Down Expand Up @@ -200,7 +200,7 @@ void classGetDeclaredConstructorShouldNotMatchIntrospectPublicConstructorsHint()
}

@Test
void classGetDeclaredConstructorShouldMatchInstrospectConstructorHint() {
void classGetDeclaredConstructorShouldMatchIntrospectConstructorHint() {
List<TypeReference> parameterTypes = List.of(TypeReference.of(byte[].class), TypeReference.of(byte.class));
hints.reflection().registerType(String.class, typeHint -> typeHint.withConstructor(parameterTypes, constructorHint -> constructorHint.setModes(ExecutableMode.INTROSPECT)));
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETDECLAREDCONSTRUCTOR, this.stringGetDeclaredConstructor);
Expand Down Expand Up @@ -317,14 +317,14 @@ void classGetDeclaredMethodsShouldMatchIntrospectPublicMethodsHint() {
}

@Test
void classGetMethodsShouldMatchInstrospectDeclaredMethodsHint() {
void classGetMethodsShouldMatchIntrospectDeclaredMethodsHint() {
RecordedInvocation invocation = RecordedInvocation.of(InstrumentedMethod.CLASS_GETMETHODS).onInstance(String.class).build();
hints.reflection().registerType(String.class, typeHint -> typeHint.withMembers(MemberCategory.INTROSPECT_DECLARED_METHODS));
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETMETHODS, invocation);
}

@Test
void classGetMethodsShouldMatchInstrospectPublicMethodsHint() {
void classGetMethodsShouldMatchIntrospectPublicMethodsHint() {
RecordedInvocation invocation = RecordedInvocation.of(InstrumentedMethod.CLASS_GETMETHODS).onInstance(String.class).build();
hints.reflection().registerType(String.class, hint -> hint.withMembers(MemberCategory.INTROSPECT_PUBLIC_METHODS));
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETMETHODS, invocation);
Expand Down Expand Up @@ -352,7 +352,7 @@ void classGetMethodsShouldNotMatchForWrongType() {
}

@Test
void classGetMethodShouldMatchInstrospectPublicMethodsHint() throws NoSuchMethodException {
void classGetMethodShouldMatchIntrospectPublicMethodsHint() throws NoSuchMethodException {
hints.reflection().registerType(String.class, typeHint -> typeHint.withMembers(MemberCategory.INTROSPECT_PUBLIC_METHODS));
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETMETHOD, this.stringGetToStringMethod);
}
Expand All @@ -364,7 +364,7 @@ void classGetMethodShouldMatchInvokePublicMethodsHint() throws NoSuchMethodExcep
}

@Test
void classGetMethodShouldMatchInstrospectDeclaredMethodsHint() throws NoSuchMethodException {
void classGetMethodShouldMatchIntrospectDeclaredMethodsHint() throws NoSuchMethodException {
hints.reflection().registerType(String.class, typeHint -> typeHint.withMembers(MemberCategory.INTROSPECT_DECLARED_METHODS));
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETMETHOD, this.stringGetToStringMethod);
}
Expand All @@ -390,13 +390,13 @@ void classGetMethodShouldMatchInvokeMethodHint() throws Exception {
}

@Test
void classGetMethodShouldNotMatchInstrospectPublicMethodsHintWhenPrivate() throws Exception {
void classGetMethodShouldNotMatchIntrospectPublicMethodsHintWhenPrivate() throws Exception {
hints.reflection().registerType(String.class, typeHint -> typeHint.withMembers(MemberCategory.INTROSPECT_PUBLIC_METHODS));
assertThatInvocationDoesNotMatch(InstrumentedMethod.CLASS_GETMETHOD, this.stringGetScaleMethod);
}

@Test
void classGetMethodShouldMatchInstrospectDeclaredMethodsHintWhenPrivate() {
void classGetMethodShouldMatchIntrospectDeclaredMethodsHintWhenPrivate() {
hints.reflection().registerType(String.class, typeHint -> typeHint.withMembers(MemberCategory.INTROSPECT_DECLARED_METHODS));
assertThatInvocationMatches(InstrumentedMethod.CLASS_GETMETHOD, this.stringGetScaleMethod);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void usingAddsSpec() {
}

@Test
void usingWhenBuilderChanagesNameThrowsException() {
void usingWhenBuilderChangesNameThrowsException() {
GeneratedMethod method = new GeneratedMethod(NAME);
assertThatIllegalArgumentException()
.isThrownBy(() -> method.using(builder -> builder.setName("badname")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @author Phillip Webb
* @since 5.2
*/
class AnnotationBackCompatibiltyTests {
class AnnotationBackCompatibilityTests {

@Test
void multiplRoutesToMetaAnnotation() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void inheritedAnnotationsStrategyOnClassHierarchyScansInCorrectOrder() {
}

@Test
void inheritedAnnotationsStrategyOnClassWhenHasAnnotationOnBothClassesIncudesOnlyOne() {
void inheritedAnnotationsStrategyOnClassWhenHasAnnotationOnBothClassesIncludesOnlyOne() {
Class<?> source = WithSingleSuperclassAndDoubleInherited.class;
assertThat(Arrays.stream(source.getAnnotations()).map(
Annotation::annotationType).map(Class::getName)).containsExactly(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void getActiveProfiles_fromSystemProperties_withMultipleProfiles() {
}

@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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ public void testSetListElementValue() {
}

@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);
}

Expand All @@ -171,12 +171,12 @@ public void testIndexingIntoUnsupportedType() {
}

@Test
public void testSetPropertyTypeCoersion() {
public void testSetPropertyTypeCoercion() {
setValue("publicBoolean", "true", Boolean.TRUE);
}

@Test
public void testSetPropertyTypeCoersionThroughSetter() {
public void testSetPropertyTypeCoercionThroughSetter() {
setValue("SomeProperty", "true", Boolean.TRUE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public void setDataSourcesIsAnIdempotentOperation() throws Exception {
@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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void shouldUseJdbc4IsValidByDefault() throws Exception {
}

@Test
void shouldCallValidatonTwiceWhenNotValid() throws Exception {
void shouldCallValidationTwiceWhenNotValid() throws Exception {
given(connection.isValid(1)).willReturn(false, true);

validator.afterPropertiesSet();
Expand All @@ -90,7 +90,7 @@ void shouldCallValidatonTwiceWhenNotValid() throws Exception {
}

@Test
void shouldCallValidatonTwiceInCaseOfException() throws Exception {
void shouldCallValidationTwiceInCaseOfException() throws Exception {
given(connection.isValid(1)).willThrow(new SQLException("Test")).willReturn(true);

validator.afterPropertiesSet();
Expand Down Expand Up @@ -118,7 +118,7 @@ void useValidationQueryInsteadOfIsValid() throws Exception {

@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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void createWithSubscribeNativeHeaders() {
}

@Test
public void createWithUnubscribeNativeHeaders() {
public void createWithUnsubscribeNativeHeaders() {
MultiValueMap<String, String> extHeaders = new LinkedMultiValueMap<>();
extHeaders.add(StompHeaderAccessor.STOMP_ID_HEADER, "s1");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void unmarshalPartialStaxSourceXmlStreamReader() throws Exception {

@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" });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AutowiredConfigurationErrorsIntegrationTests {
AutowiredRepeatedTestMethod.class,
AutowiredParameterizedTestMethod.class
})
void autowiredTestMethodsTestTemplateMethodsAndLifecyleMethods(Class<?> testClass) {
void AutowiredTestMethodsTestTemplateMethodsAndLifecycleMethods(Class<?> testClass) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: we never capitalize the first character in a method name.

So I'll revert these changes when merging.

testEventsFor(testClass)
.assertStatistics(stats -> stats.started(1).succeeded(0).failed(1))
.assertThatEvents().haveExactly(1,
Expand Down Expand Up @@ -111,7 +111,7 @@ void autowiredAndNonAutowiredTestMethods() {
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void resolveActiveProfilesWithMergedInheritedResolver() {
* @since 4.0
*/
@Test
void resolveActiveProfilesWithOverridenInheritedResolver() {
void resolveActiveProfilesWithOverriddenInheritedResolver() {
assertResolvedProfiles(OverriddenInheritedFooActiveProfilesResolverTestCase.class, "bar");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void declaredViaMetaAnnotationWithOverrides() throws Exception {

@Test
void declaredViaMetaAnnotationWithOverriddenAttributes() throws Exception {
assertAfterClass(DirtiesContextViaMetaAnnotationWithOverridenAttributes.class);
assertAfterClass(DirtiesContextViaMetaAnnotationWithOverriddenAttributes.class);
}
}

Expand Down Expand Up @@ -447,7 +447,7 @@ void test() {
}

@MetaDirtyWithOverrides(classMode = AFTER_CLASS, hierarchyMode = EXHAUSTIVE)
static class DirtiesContextViaMetaAnnotationWithOverridenAttributes {
static class DirtiesContextViaMetaAnnotationWithOverriddenAttributes {

void test() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void controllerAdviceWithClassArgument() {
@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<>();
Expand All @@ -84,7 +84,7 @@ public void configurerConsumers() {

new DefaultControllerSpec(new MyController())
.argumentResolvers(argumentResolverConsumer)
.contentTypeResolver(contenTypeResolverConsumer)
.contentTypeResolver(contentTypeResolverConsumer)
.corsMappings(corsRegistryConsumer)
.formatters(formatterConsumer)
.httpMessageCodecs(codecsConsumer)
Expand All @@ -93,7 +93,7 @@ public void configurerConsumers() {
.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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void optionalEmpty() {
}

@Test
void optionalEmpthyWithDefaultValue() {
void optionalEmptyWithDefaultValue() {
this.service.executeOptionalWithDefaultValue(Optional.empty());
assertTestValue("value", "default");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public String handleDateParam(@RequestParam Date date) {
}

@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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public void defaultLocaleResolverConfiguration() {
}

@Test
public void defaultThemeResolverfiguration() {
public void defaultThemeResolverConfiguration() {
ApplicationContext context = initContext(WebConfig.class);
ThemeResolver themeResolver = context.getBean(THEME_RESOLVER_BEAN_NAME, ThemeResolver.class);

Expand Down
Loading