org.unitils.spring.annotation
Annotation Type SpringApplicationContext
@Target(value={TYPE,FIELD,METHOD})
@Retention(value=RUNTIME)
public @interface SpringApplicationContext
This annotation can be used in three different ways:
-
If its value attribute is specified, the goal is to configure a spring
ApplicationContext
for this
test object.
-
If this attributes is not specified and the annotation is put on a field of type
ApplicationContext
or a method that takes a single parameter of type ApplicationContext
, the ApplicationContext
for this test object is injected into this field or method.
-
If put on a method with no parameter or a single parameter of type
List<String>
that returns an
ApplicationContext
, this method becomes a custom create for this test class. If it has a parameter,
this method will be invoked with the config locations as parameter. The result of this method should be an instance
of an application context for which the refresh() method was not yet invoked.
- Author:
- Filip Neven, Tim Ducheyne
value
public abstract String[] value
- Default:
- {}
Copyright © 2011. All Rights Reserved.