Standard Annotation Support
对于 Spring TestContext Framework 的所有配置,以下注释都受支持,并具有标准语义。请注意,这些注释不适用于特定测试,可以在 Spring Framework 中的任何位置使用。
The following annotations are supported with standard semantics for all configurations of the Spring TestContext Framework. Note that these annotations are not specific to tests and can be used anywhere in the Spring Framework.
-
@Autowired
-
@Qualifier
-
@Value
-
@Resource
(jakarta.annotation) if JSR-250 is present -
@ManagedBean
(jakarta.annotation) if JSR-250 is present -
@Inject
(jakarta.inject) if JSR-330 is present -
@Named
(jakarta.inject) if JSR-330 is present -
@PersistenceContext
(jakarta.persistence) if JPA is present -
@PersistenceUnit
(jakarta.persistence) if JPA is present -
@Transactional
(org.springframework.transaction.annotation) with limited attribute support
JSR-250 Lifecycle Annotations
在 Spring TestContext Framework 中,您可以在 In the Spring TestContext Framework, you can use 如果测试类中的一个方法带有 If a method within a test class is annotated with |