Annotation Type TestReference


  • @Target(FIELD)
    @Retention(RUNTIME)
    @Deprecated
    public @interface TestReference
    Deprecated.
    - the {#link TeleporterRule} is a much simpler way of executing server-side tests, including OSGi service injection.
    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.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String name
      Deprecated.
      The local name of the reference.
      java.lang.Class<?> referenceInterface
      Deprecated.
      The name of the service interface.
    • Element Detail

      • name

        java.lang.String name
        Deprecated.
        The local name of the reference. Default value is the name of the field to which the annotation applies.
        Default:
        ""
      • referenceInterface

        java.lang.Class<?> referenceInterface
        Deprecated.
        The 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.
        Default:
        org.apache.sling.junit.annotations.AutoDetect.class