Merge branch '5.3.x'

# Conflicts:
#	spring-core/src/test/java/org/springframework/core/annotation/TypeMappedAnnotationTests.java
#	spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java
#	spring-test/src/test/java/org/springframework/test/util/MetaAnnotationUtilsTests.java
#	spring-test/src/test/java/org/springframework/test/util/OverriddenMetaAnnotationAttributesTests.java
This commit is contained in:
Sam Brannen
2022-07-09 16:24:04 +02:00
37 changed files with 114 additions and 140 deletions

View File

@@ -118,28 +118,28 @@ class ThisAndTargetSelectionOnlyPointcutsAtAspectJTests {
assertThat(counter.atAnnotationMethodAnnotationCounter).isEqualTo(1);
}
public static interface TestInterface {
interface TestInterface {
public void doIt();
}
public static class TestImpl implements TestInterface {
static class TestImpl implements TestInterface {
@Override
public void doIt() {
}
}
@Retention(RetentionPolicy.RUNTIME)
public static @interface TestAnnotation {
@interface TestAnnotation {
}
@TestAnnotation
public static class AnnotatedClassTestImpl implements TestInterface {
static class AnnotatedClassTestImpl implements TestInterface {
@Override
public void doIt() {
}
}
public static class AnnotatedMethodTestImpl implements TestInterface {
static class AnnotatedMethodTestImpl implements TestInterface {
@Override
@TestAnnotation
public void doIt() {
@@ -147,7 +147,7 @@ class ThisAndTargetSelectionOnlyPointcutsAtAspectJTests {
}
@Aspect
public static class Counter {
static class Counter {
int thisAsClassCounter;
int thisAsInterfaceCounter;
int targetAsClassCounter;

View File

@@ -79,7 +79,7 @@ class GenericParameterMatchingTests {
}
static interface GenericInterface<T> {
interface GenericInterface<T> {
void save(T bean);

View File

@@ -1770,7 +1770,7 @@ public abstract class AbstractAopProxyTests {
}
public static interface IOverloads {
public interface IOverloads {
void overload();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,13 +44,13 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Chris Beams
* @author Sam Brannen
*/
public class AnnotationBeanNameGeneratorTests {
class AnnotationBeanNameGeneratorTests {
private AnnotationBeanNameGenerator beanNameGenerator = new AnnotationBeanNameGenerator();
@Test
public void generateBeanNameWithNamedComponent() {
void generateBeanNameWithNamedComponent() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentWithName.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@@ -60,7 +60,7 @@ public class AnnotationBeanNameGeneratorTests {
}
@Test
public void generateBeanNameWithDefaultNamedComponent() {
void generateBeanNameWithDefaultNamedComponent() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(DefaultNamedComponent.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@@ -70,7 +70,7 @@ public class AnnotationBeanNameGeneratorTests {
}
@Test
public void generateBeanNameWithNamedComponentWhereTheNameIsBlank() {
void generateBeanNameWithNamedComponentWhereTheNameIsBlank() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentWithBlankName.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@@ -81,7 +81,7 @@ public class AnnotationBeanNameGeneratorTests {
}
@Test
public void generateBeanNameWithAnonymousComponentYieldsGeneratedBeanName() {
void generateBeanNameWithAnonymousComponentYieldsGeneratedBeanName() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(AnonymousComponent.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@@ -92,7 +92,7 @@ public class AnnotationBeanNameGeneratorTests {
}
@Test
public void generateBeanNameFromMetaComponentWithStringValue() {
void generateBeanNameFromMetaComponentWithStringValue() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentFromStringMeta.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@@ -100,7 +100,7 @@ public class AnnotationBeanNameGeneratorTests {
}
@Test
public void generateBeanNameFromMetaComponentWithNonStringValue() {
void generateBeanNameFromMetaComponentWithNonStringValue() {
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComponentFromNonStringMeta.class);
String beanName = this.beanNameGenerator.generateBeanName(bd, registry);
@@ -108,7 +108,7 @@ public class AnnotationBeanNameGeneratorTests {
}
@Test
public void generateBeanNameFromComposedControllerAnnotationWithoutName() {
void generateBeanNameFromComposedControllerAnnotationWithoutName() {
// SPR-11360
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComposedControllerAnnotationWithoutName.class);
@@ -118,7 +118,7 @@ public class AnnotationBeanNameGeneratorTests {
}
@Test
public void generateBeanNameFromComposedControllerAnnotationWithBlankName() {
void generateBeanNameFromComposedControllerAnnotationWithBlankName() {
// SPR-11360
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(ComposedControllerAnnotationWithBlankName.class);
@@ -128,7 +128,7 @@ public class AnnotationBeanNameGeneratorTests {
}
@Test
public void generateBeanNameFromComposedControllerAnnotationWithStringValue() {
void generateBeanNameFromComposedControllerAnnotationWithStringValue() {
// SPR-11360
BeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
AnnotatedBeanDefinition bd = new AnnotatedGenericBeanDefinition(
@@ -157,7 +157,7 @@ public class AnnotationBeanNameGeneratorTests {
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Component
public @interface NonStringMetaComponent {
@interface NonStringMetaComponent {
long value();
}
@@ -172,21 +172,21 @@ public class AnnotationBeanNameGeneratorTests {
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Controller
public static @interface TestRestController {
@interface TestRestController {
String value() default "";
}
@TestRestController
public static class ComposedControllerAnnotationWithoutName {
static class ComposedControllerAnnotationWithoutName {
}
@TestRestController(" ")
public static class ComposedControllerAnnotationWithBlankName {
static class ComposedControllerAnnotationWithBlankName {
}
@TestRestController("restController")
public static class ComposedControllerAnnotationWithStringValue {
static class ComposedControllerAnnotationWithStringValue {
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,17 +27,14 @@ import org.springframework.beans.factory.config.BeanDefinition;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Phillip Webb
* @author Juergen Hoeller
*/
public class BeanMethodMetadataTests {
class BeanMethodMetadataTests {
@Test
public void providesBeanMethodBeanDefinition() throws Exception {
void providesBeanMethodBeanDefinition() throws Exception {
AnnotationConfigApplicationContext context= new AnnotationConfigApplicationContext(Conf.class);
BeanDefinition beanDefinition = context.getBeanDefinition("myBean");
assertThat(beanDefinition).as("should provide AnnotatedBeanDefinition").isInstanceOf(AnnotatedBeanDefinition.class);
@@ -53,7 +50,7 @@ public class BeanMethodMetadataTests {
@Bean
@MyAnnotation("test")
public MyBean myBean() {
MyBean myBean() {
return new MyBean();
}
}
@@ -64,7 +61,7 @@ public class BeanMethodMetadataTests {
@Retention(RetentionPolicy.RUNTIME)
public static @interface MyAnnotation {
@interface MyAnnotation {
String value();
}

View File

@@ -53,6 +53,6 @@ class WithNestedAnnotation {
@Retention(RetentionPolicy.RUNTIME)
@Component
public static @interface MyComponent {
@interface MyComponent {
}
}

View File

@@ -724,7 +724,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
}
public static interface PersonMBean {
public interface PersonMBean {
String getName();
}