Annotation Type TestReference
Annotation used to inject services in test classes. Similar to the Felix @Reference annotation, but we need RetentionPolicy.RUNTIME so we
cannot use that one.
FYI {#link TeleporterRule} is another way of executing server-side tests, including OSGi service injection.
-
Optional Element Summary
Optional Elements
-
Element Details
-
name
String nameThe local name of the reference. Default value is the name of the field to which the annotation applies.- Returns:
- the local name of the reference ("" by default)
- Default:
""
-
target
String targetLDAP-style filter for targeting a specific reference implementation- Returns:
- the local name of the reference ("" by default)
- Default:
""
-
referenceInterface
Class<?> referenceInterfaceThe name of the service interface. This name is used by the Service Component Runtime to access the service on behalf of the component. The default value for is the type of the field to which the annotation applies.- Returns:
- the service interface
- Default:
org.apache.sling.junit.annotations.AutoDetect.class
-