Browse Source

Clarify supported targets for annotations in the TestContext framework

Closes gh-32772
pull/34537/head
Sam Brannen 2 years ago
parent
commit
ac0136b75c
  1. 10
      framework-docs/modules/ROOT/pages/testing/annotations/integration-junit-jupiter.adoc
  2. 19
      framework-docs/modules/ROOT/pages/testing/annotations/integration-junit4.adoc
  3. 4
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-activeprofiles.adoc
  4. 6
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-bootstrapwith.adoc
  5. 8
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contextconfiguration.adoc
  6. 8
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contextcustomizerfactories.adoc
  7. 12
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contexthierarchy.adoc
  8. 6
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dirtiescontext.adoc
  9. 2
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-disabledinaotmode.adoc
  10. 12
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dynamicpropertysource.adoc
  11. 6
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-recordapplicationevents.adoc
  12. 2
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testexecutionlisteners.adoc
  13. 4
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testpropertysource.adoc
  14. 8
      framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-webappconfiguration.adoc
  15. 4
      spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java
  16. 6
      spring-test/src/main/java/org/springframework/test/annotation/IfProfileValue.java
  17. 6
      spring-test/src/main/java/org/springframework/test/annotation/ProfileValueSourceConfiguration.java
  18. 10
      spring-test/src/main/java/org/springframework/test/context/ActiveProfiles.java
  19. 7
      spring-test/src/main/java/org/springframework/test/context/BootstrapWith.java
  20. 9
      spring-test/src/main/java/org/springframework/test/context/ContextConfiguration.java
  21. 8
      spring-test/src/main/java/org/springframework/test/context/ContextCustomizerFactories.java
  22. 6
      spring-test/src/main/java/org/springframework/test/context/ContextHierarchy.java
  23. 7
      spring-test/src/main/java/org/springframework/test/context/DynamicPropertySource.java
  24. 8
      spring-test/src/main/java/org/springframework/test/context/NestedTestConfiguration.java
  25. 8
      spring-test/src/main/java/org/springframework/test/context/TestConstructor.java
  26. 8
      spring-test/src/main/java/org/springframework/test/context/TestExecutionListeners.java
  27. 6
      spring-test/src/main/java/org/springframework/test/context/TestPropertySource.java
  28. 4
      spring-test/src/main/java/org/springframework/test/context/aot/DisabledInAotMode.java
  29. 6
      spring-test/src/main/java/org/springframework/test/context/event/RecordApplicationEvents.java
  30. 8
      spring-test/src/main/java/org/springframework/test/context/web/WebAppConfiguration.java

10
framework-docs/modules/ROOT/pages/testing/annotations/integration-junit-jupiter.adoc

@ -165,8 +165,8 @@ for further details. @@ -165,8 +165,8 @@ for further details.
[[integration-testing-annotations-testconstructor]]
== `@TestConstructor`
`@TestConstructor` is a type-level annotation that is used to configure how the parameters
of a test class constructor are autowired from components in the test's
`@TestConstructor` is an annotation that can be applied to a test class to configure how
the parameters of a test class constructor are autowired from components in the test's
`ApplicationContext`.
If `@TestConstructor` is not present or meta-present on a test class, the default _test
@ -199,9 +199,9 @@ Spring Boot Test. @@ -199,9 +199,9 @@ Spring Boot Test.
[[integration-testing-annotations-nestedtestconfiguration]]
== `@NestedTestConfiguration`
`@NestedTestConfiguration` is a type-level annotation that is used to configure how
Spring test configuration annotations are processed within enclosing class hierarchies
for inner test classes.
`@NestedTestConfiguration` is an annotation that can be applied to a test class to
configure how Spring test configuration annotations are processed within enclosing class
hierarchies for inner test classes.
If `@NestedTestConfiguration` is not present or meta-present on a test class, in its
supertype hierarchy, or in its enclosing class hierarchy, the default _enclosing

19
framework-docs/modules/ROOT/pages/testing/annotations/integration-junit4.adoc

@ -13,10 +13,10 @@ xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit4-runne @@ -13,10 +13,10 @@ xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit4-runne
[[integration-testing-annotations-junit4-ifprofilevalue]]
== `@IfProfileValue`
`@IfProfileValue` indicates that the annotated test is enabled for a specific testing
environment. If the configured `ProfileValueSource` returns a matching `value` for the
provided `name`, the test is enabled. Otherwise, the test is disabled and, effectively,
ignored.
`@IfProfileValue` indicates that the annotated test class or test method is enabled for a
specific testing environment. If the configured `ProfileValueSource` returns a matching
`value` for the provided `name`, the test is enabled. Otherwise, the test is disabled
and, effectively, ignored.
You can apply `@IfProfileValue` at the class level, the method level, or both.
Class-level usage of `@IfProfileValue` takes precedence over method-level usage for any
@ -90,11 +90,12 @@ Kotlin:: @@ -90,11 +90,12 @@ Kotlin::
[[integration-testing-annotations-junit4-profilevaluesourceconfiguration]]
== `@ProfileValueSourceConfiguration`
`@ProfileValueSourceConfiguration` is a class-level annotation that specifies what type
of `ProfileValueSource` to use when retrieving profile values configured through the
`@IfProfileValue` annotation. If `@ProfileValueSourceConfiguration` is not declared for a
test, `SystemProfileValueSource` is used by default. The following example shows how to
use `@ProfileValueSourceConfiguration`:
`@ProfileValueSourceConfiguration` is an annotation that can be applied to a test class
to specify what type of `ProfileValueSource` to use when retrieving profile values
configured through the `@IfProfileValue` annotation. If
`@ProfileValueSourceConfiguration` is not declared for a test, `SystemProfileValueSource`
is used by default. The following example shows how to use
`@ProfileValueSourceConfiguration`:
[tabs]
======

4
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-activeprofiles.adoc

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
[[spring-testing-annotation-activeprofiles]]
= `@ActiveProfiles`
`@ActiveProfiles` is a class-level annotation that is used to declare which bean
definition profiles should be active when loading an `ApplicationContext` for an
`@ActiveProfiles` is an annotation that can be applied to a test class to declare which
bean definition profiles should be active when loading an `ApplicationContext` for an
integration test.
The following example indicates that the `dev` profile should be active:

6
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-bootstrapwith.adoc

@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
= `@BootstrapWith`
:page-section-summary-toc: 1
`@BootstrapWith` is a class-level annotation that you can use to configure how the Spring
TestContext Framework is bootstrapped. Specifically, you can use `@BootstrapWith` to
specify a custom `TestContextBootstrapper`. See the section on
`@BootstrapWith` is an annotation that can be applied to a test class to configure how
the Spring TestContext Framework is bootstrapped. Specifically, you can use
`@BootstrapWith` to specify a custom `TestContextBootstrapper`. See the section on
xref:testing/testcontext-framework/bootstrapping.adoc[bootstrapping the TestContext framework] for further details.

8
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contextconfiguration.adoc

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
[[spring-testing-annotation-contextconfiguration]]
= `@ContextConfiguration`
`@ContextConfiguration` defines class-level metadata that is used to determine how to
load and configure an `ApplicationContext` for integration tests. Specifically,
`@ContextConfiguration` declares the application context resource `locations` or the
component `classes` used to load the context.
`@ContextConfiguration` is an annotation that can be applied to a test class to configure
metadata that is used to determine how to load and configure an `ApplicationContext` for
integration tests. Specifically, `@ContextConfiguration` declares the application context
resource `locations` or the component `classes` used to load the context.
Resource locations are typically XML configuration files or Groovy scripts located in the
classpath, while component classes are typically `@Configuration` classes. However,

8
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contextcustomizerfactories.adoc

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
[[spring-testing-annotation-contextcustomizerfactories]]
= `@ContextCustomizerFactories`
`@ContextCustomizerFactories` is used to register `ContextCustomizerFactory`
implementations for a particular test class, its subclasses, and its nested classes. If
you wish to register a factory globally, you should register it via the automatic
discovery mechanism described in
`@ContextCustomizerFactories` is an annotation that can be applied to a test class to
register `ContextCustomizerFactory` implementations for the particular test class, its
subclasses, and its nested classes. If you wish to register a factory globally, you
should register it via the automatic discovery mechanism described in
xref:testing/testcontext-framework/ctx-management/context-customizers.adoc[`ContextCustomizerFactory` Configuration].
The following example shows how to register two `ContextCustomizerFactory` implementations:

12
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-contexthierarchy.adoc

@ -1,12 +1,12 @@ @@ -1,12 +1,12 @@
[[spring-testing-annotation-contexthierarchy]]
= `@ContextHierarchy`
`@ContextHierarchy` is a class-level annotation that is used to define a hierarchy of
`ApplicationContext` instances for integration tests. `@ContextHierarchy` should be
declared with a list of one or more `@ContextConfiguration` instances, each of which
defines a level in the context hierarchy. The following examples demonstrate the use of
`@ContextHierarchy` within a single test class (`@ContextHierarchy` can also be used
within a test class hierarchy):
`@ContextHierarchy` is an annotation that can be applied to a test class to define a
hierarchy of `ApplicationContext` instances for integration tests. `@ContextHierarchy`
should be declared with a list of one or more `@ContextConfiguration` instances, each of
which defines a level in the context hierarchy. The following examples demonstrate the
use of `@ContextHierarchy` within a single test class (`@ContextHierarchy` can also be
used within a test class hierarchy):
[tabs]
======

6
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dirtiescontext.adoc

@ -10,9 +10,9 @@ rebuilt for any subsequent test that requires a context with the same configurat @@ -10,9 +10,9 @@ rebuilt for any subsequent test that requires a context with the same configurat
metadata.
You can use `@DirtiesContext` as both a class-level and a method-level annotation within
the same class or class hierarchy. In such scenarios, the `ApplicationContext` is marked
as dirty before or after any such annotated method as well as before or after the current
test class, depending on the configured `methodMode` and `classMode`. When
the same test class or test class hierarchy. In such scenarios, the `ApplicationContext`
is marked as dirty before or after any such annotated method as well as before or after
the current test class, depending on the configured `methodMode` and `classMode`. When
`@DirtiesContext` is declared at both the class level and the method level, the
configured modes from both annotations will be honored. For example, if the class mode is
set to `BEFORE_EACH_TEST_METHOD` and the method mode is set to `AFTER_METHOD`, the

2
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-disabledinaotmode.adoc

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
[[spring-testing-annotation-disabledinaotmode]]
= `@DisabledInAotMode`
`@DisabledInAotMode` signals that an annotated test class is disabled in Spring AOT
`@DisabledInAotMode` signals that the annotated test class is disabled in Spring AOT
(ahead-of-time) mode, which means that the `ApplicationContext` for the test class will
not be processed for AOT optimizations at build time.

12
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-dynamicpropertysource.adoc

@ -1,12 +1,12 @@ @@ -1,12 +1,12 @@
[[spring-testing-annotation-dynamicpropertysource]]
= `@DynamicPropertySource`
`@DynamicPropertySource` is a method-level annotation that you can use to register
_dynamic_ properties to be added to the set of `PropertySources` in the `Environment` for
an `ApplicationContext` loaded for an integration test. Dynamic properties are useful
when you do not know the value of the properties upfront – for example, if the properties
are managed by an external resource such as for a container managed by the
{testcontainers-site}[Testcontainers] project.
`@DynamicPropertySource` is an annotation that can be applied to methods in integration
test classes that need to register _dynamic_ properties to be added to the set of
`PropertySources` in the `Environment` for an `ApplicationContext` loaded for an
integration test. Dynamic properties are useful when you do not know the value of the
properties upfront – for example, if the properties are managed by an external resource
such as for a container managed by the {testcontainers-site}[Testcontainers] project.
The following example demonstrates how to register a dynamic property:

6
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-recordapplicationevents.adoc

@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
= `@RecordApplicationEvents`
:page-section-summary-toc: 1
`@RecordApplicationEvents` is a class-level annotation that is used to instruct the
_Spring TestContext Framework_ to record all application events that are published in the
`ApplicationContext` during the execution of a single test.
`@RecordApplicationEvents` is an annotation that can be applied to a test class to
instruct the _Spring TestContext Framework_ to record all application events that are
published in the `ApplicationContext` during the execution of a single test.
The recorded events can be accessed via the `ApplicationEvents` API within tests.

2
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testexecutionlisteners.adoc

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
[[spring-testing-annotation-testexecutionlisteners]]
= `@TestExecutionListeners`
`@TestExecutionListeners` is used to register listeners for a particular test class, its
`@TestExecutionListeners` is used to register listeners for the annotated test class, its
subclasses, and its nested classes. If you wish to register a listener globally, you
should register it via the automatic discovery mechanism described in
xref:testing/testcontext-framework/tel-config.adoc[`TestExecutionListener` Configuration].

4
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-testpropertysource.adoc

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
[[spring-testing-annotation-testpropertysource]]
= `@TestPropertySource`
`@TestPropertySource` is a class-level annotation that you can use to configure the
locations of properties files and inlined properties to be added to the set of
`@TestPropertySource` is an annotation that can be applied to a test class to configure
the locations of properties files and inlined properties to be added to the set of
`PropertySources` in the `Environment` for an `ApplicationContext` loaded for an
integration test.

8
framework-docs/modules/ROOT/pages/testing/annotations/integration-spring/annotation-webappconfiguration.adoc

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
[[spring-testing-annotation-webappconfiguration]]
= `@WebAppConfiguration`
`@WebAppConfiguration` is a class-level annotation that you can use to declare that the
`ApplicationContext` loaded for an integration test should be a `WebApplicationContext`.
The mere presence of `@WebAppConfiguration` on a test class ensures that a
`WebApplicationContext` is loaded for the test, using the default value of
`@WebAppConfiguration` is an annotation that can be applied to a test class to declare
that the `ApplicationContext` loaded for an integration test should be a
`WebApplicationContext`. The mere presence of `@WebAppConfiguration` on a test class
ensures that a `WebApplicationContext` is loaded for the test, using the default value of
`"file:src/main/webapp"` for the path to the root of the web application (that is, the
resource base path). The resource base path is used behind the scenes to create a
`MockServletContext`, which serves as the `ServletContext` for the test's

4
spring-test/src/main/java/org/springframework/test/annotation/DirtiesContext.java

@ -35,8 +35,8 @@ import java.lang.annotation.Target; @@ -35,8 +35,8 @@ import java.lang.annotation.Target;
* will be supplied a new context.
*
* <p>{@code @DirtiesContext} may be used as a class-level and method-level
* annotation within the same class or class hierarchy. In such scenarios, the
* {@code ApplicationContext} will be marked as <em>dirty</em> before or
* annotation within the same test class or test class hierarchy. In such scenarios,
* the {@code ApplicationContext} will be marked as <em>dirty</em> before or
* after any such annotated method as well as before or after the current test
* class, depending on the configured {@link #methodMode} and {@link #classMode}.
* When {@code @DirtiesContext} is declared at both the class level and the

6
spring-test/src/main/java/org/springframework/test/annotation/IfProfileValue.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2024 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.
@ -24,8 +24,8 @@ import java.lang.annotation.RetentionPolicy; @@ -24,8 +24,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Test annotation for use with JUnit 4 to indicate whether a test is enabled or
* disabled for a specific testing profile.
* Test annotation for use with JUnit 4 to indicate whether the annotated test
* class or test method is enabled or disabled for a specific testing profile.
*
* <p>In the context of this annotation, the term <em>profile</em> refers to
* a Java system property by default; however, the semantics can be changed

6
spring-test/src/main/java/org/springframework/test/annotation/ProfileValueSourceConfiguration.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2024 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.
@ -24,8 +24,8 @@ import java.lang.annotation.RetentionPolicy; @@ -24,8 +24,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* {@code ProfileValueSourceConfiguration} is a class-level annotation for use
* with JUnit 4 which is used to specify what type of {@link ProfileValueSource}
* {@code ProfileValueSourceConfiguration} is an annotation that can be applied
* to a JUnit 4 based test class to specify what type of {@link ProfileValueSource}
* to use when retrieving <em>profile values</em> configured via
* {@link IfProfileValue @IfProfileValue}.
*

10
spring-test/src/main/java/org/springframework/test/context/ActiveProfiles.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 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.
@ -26,10 +26,10 @@ import java.lang.annotation.Target; @@ -26,10 +26,10 @@ import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
/**
* {@code ActiveProfiles} is a class-level annotation that is used to declare
* which <em>active bean definition profiles</em> should be used when loading
* an {@link org.springframework.context.ApplicationContext ApplicationContext}
* for test classes.
* {@code ActiveProfiles} is an annotation that can be applied to a test class
* to declare which <em>active bean definition profiles</em> should be used when
* loading an {@link org.springframework.context.ApplicationContext ApplicationContext}
* for integration tests.
*
* <p>This annotation may be used as a <em>meta-annotation</em> to create custom
* <em>composed annotations</em>.

7
spring-test/src/main/java/org/springframework/test/context/BootstrapWith.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2024 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.
@ -24,8 +24,9 @@ import java.lang.annotation.RetentionPolicy; @@ -24,8 +24,9 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* {@code @BootstrapWith} defines class-level metadata that is used to determine
* how to bootstrap the <em>Spring TestContext Framework</em>.
* {@code @BootstrapWith} is an annotation that can be applied to a test class
* to define metadata that is used to determine how to bootstrap the
* <em>Spring TestContext Framework</em>.
*
* <p>This annotation may also be used as a <em>meta-annotation</em> to create
* custom <em>composed annotations</em>. As of Spring Framework 5.1, a locally

9
spring-test/src/main/java/org/springframework/test/context/ContextConfiguration.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@ -28,9 +28,10 @@ import org.springframework.context.ConfigurableApplicationContext; @@ -28,9 +28,10 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.annotation.AliasFor;
/**
* {@code @ContextConfiguration} defines class-level metadata that is used to determine
* how to load and configure an {@link org.springframework.context.ApplicationContext
* ApplicationContext} for integration tests.
* {@code @ContextConfiguration} is an annotation that can be applied to a test
* class to define metadata that is used to determine how to load and configure
* an {@link org.springframework.context.ApplicationContext ApplicationContext}
* for integration tests.
*
* <h3>Supported Resource Types</h3>
*

8
spring-test/src/main/java/org/springframework/test/context/ContextCustomizerFactories.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@ -26,9 +26,9 @@ import java.lang.annotation.Target; @@ -26,9 +26,9 @@ import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
/**
* {@code @ContextCustomizerFactories} defines class-level metadata for configuring
* which {@link ContextCustomizerFactory} implementations should be registered with
* the <em>Spring TestContext Framework</em>.
* {@code @ContextCustomizerFactories} is an annotation that can be applied to a
* test class to configure which {@link ContextCustomizerFactory} implementations
* should be registered with the <em>Spring TestContext Framework</em>.
*
* <p>{@code @ContextCustomizerFactories} is used to register factories for a
* particular test class, its subclasses, and its nested classes. If you wish to

6
spring-test/src/main/java/org/springframework/test/context/ContextHierarchy.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 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.
@ -24,8 +24,8 @@ import java.lang.annotation.RetentionPolicy; @@ -24,8 +24,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* {@code @ContextHierarchy} is a class-level annotation that is used to define
* a hierarchy of {@link org.springframework.context.ApplicationContext
* {@code @ContextHierarchy} is an annotation that can be applied to a test class
* to define a hierarchy of {@link org.springframework.context.ApplicationContext
* ApplicationContexts} for integration tests.
*
* <h3>Examples</h3>

7
spring-test/src/main/java/org/springframework/test/context/DynamicPropertySource.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@ -23,8 +23,9 @@ import java.lang.annotation.RetentionPolicy; @@ -23,8 +23,9 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Method-level annotation for integration tests that need to add properties with
* dynamic values to the {@code Environment}'s set of {@code PropertySources}.
* {@code @DynamicPropertySource} is an annotation that can be applied to methods
* in integration test classes that need to add properties with dynamic values to
* the {@code Environment}'s set of {@code PropertySources}.
*
* <p>This annotation and its supporting infrastructure were originally designed
* to allow properties from

8
spring-test/src/main/java/org/springframework/test/context/NestedTestConfiguration.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@ -29,9 +29,9 @@ import org.apache.commons.logging.LogFactory; @@ -29,9 +29,9 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.lang.Nullable;
/**
* {@code @NestedTestConfiguration} is a type-level annotation that is used to
* configure how Spring test configuration annotations are processed within
* enclosing class hierarchies (i.e., for <em>inner</em> test classes).
* {@code @NestedTestConfiguration} is an annotation that can be applied to a test
* class to configure how Spring test configuration annotations are processed
* within enclosing class hierarchies (i.e., for <em>inner</em> test classes).
*
* <p>If {@code @NestedTestConfiguration} is not <em>present</em> or
* <em>meta-present</em> on a test class, in its supertype hierarchy, or in its

8
spring-test/src/main/java/org/springframework/test/context/TestConstructor.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@ -29,9 +29,9 @@ import org.apache.commons.logging.LogFactory; @@ -29,9 +29,9 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.lang.Nullable;
/**
* {@code @TestConstructor} is a type-level annotation that is used to configure
* how the parameters of a test class constructor are autowired from components
* in the test's {@link org.springframework.context.ApplicationContext
* {@code @TestConstructor} is an annotation that can be applied to a test class
* to configure how the parameters of a test class constructor are autowired from
* components in the test's {@link org.springframework.context.ApplicationContext
* ApplicationContext}.
*
* <p>If {@code @TestConstructor} is not <em>present</em> or <em>meta-present</em>

8
spring-test/src/main/java/org/springframework/test/context/TestExecutionListeners.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 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.
@ -26,9 +26,9 @@ import java.lang.annotation.Target; @@ -26,9 +26,9 @@ import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
/**
* {@code TestExecutionListeners} defines class-level metadata for configuring
* which {@link TestExecutionListener TestExecutionListeners} should be
* registered with a {@link TestContextManager}.
* {@code @TestExecutionListeners} is an annotation that can be applied to a test
* class to configure which {@link TestExecutionListener TestExecutionListeners}
* should be registered with a {@link TestContextManager}.
*
* <p>{@code @TestExecutionListeners} is used to register listeners for a
* particular test class, its subclasses, and its nested classes. If you wish to

6
spring-test/src/main/java/org/springframework/test/context/TestPropertySource.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@ -28,8 +28,8 @@ import org.springframework.core.annotation.AliasFor; @@ -28,8 +28,8 @@ import org.springframework.core.annotation.AliasFor;
import org.springframework.core.io.support.PropertySourceFactory;
/**
* {@code @TestPropertySource} is a class-level annotation that is used to
* configure the {@link #locations} of properties files and inlined
* {@code @TestPropertySource} is an annotation that can be applied to a test
* class to configure the {@link #locations} of properties files and inlined
* {@link #properties} to be added to the {@code Environment}'s set of
* {@code PropertySources} for an
* {@link org.springframework.context.ApplicationContext ApplicationContext}

4
spring-test/src/main/java/org/springframework/test/context/aot/DisabledInAotMode.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@ -25,7 +25,7 @@ import java.lang.annotation.Target; @@ -25,7 +25,7 @@ import java.lang.annotation.Target;
import org.junit.jupiter.api.extension.ExtendWith;
/**
* {@code @DisabledInAotMode} signals that an annotated test class is <em>disabled</em>
* {@code @DisabledInAotMode} signals that the annotated test class is <em>disabled</em>
* in Spring AOT (ahead-of-time) mode, which means that the {@code ApplicationContext}
* for the test class will not be processed for AOT optimizations at build time.
*

6
spring-test/src/main/java/org/springframework/test/context/event/RecordApplicationEvents.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@ -24,8 +24,8 @@ import java.lang.annotation.RetentionPolicy; @@ -24,8 +24,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* {@code @RecordApplicationEvents} is a class-level annotation that is used to
* instruct the <em>Spring TestContext Framework</em> to record all
* {@code @RecordApplicationEvents} is an annotation that can be applied to a test
* class to instruct the <em>Spring TestContext Framework</em> to record all
* {@linkplain org.springframework.context.ApplicationEvent application events}
* that are published in the {@link org.springframework.context.ApplicationContext
* ApplicationContext} during the execution of a single test, either from the

8
spring-test/src/main/java/org/springframework/test/context/web/WebAppConfiguration.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2024 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.
@ -24,9 +24,9 @@ import java.lang.annotation.RetentionPolicy; @@ -24,9 +24,9 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* {@code @WebAppConfiguration} is a class-level annotation that is used to
* declare that the {@code ApplicationContext} loaded for an integration test
* should be a {@link org.springframework.web.context.WebApplicationContext
* {@code @WebAppConfiguration} is an annotation that can be applied to a test
* class to declare that the {@code ApplicationContext} loaded for an integration
* test should be a {@link org.springframework.web.context.WebApplicationContext
* WebApplicationContext}.
*
* <p>The presence of {@code @WebAppConfiguration} on a test class indicates that

Loading…
Cancel
Save