Package org.apache.sling.junit.jupiter.osgi

# Annotation Type OSGi

@Retention(RUNTIME) @Target({TYPE,METHOD}) @ExtendWith({org.apache.sling.junit.jupiter.osgi.BundleParameterResolver.class,org.apache.sling.junit.jupiter.osgi.BundleContextParameterResolver.class,org.apache.sling.junit.jupiter.osgi.ServiceParameterResolver.class}) @Inherited public @interface OSGi
OSGi test annotation, for running unit tests within OSGi frameworks. The annotation supports injecting `Bundle`, `BundleContext` and service instances in conjunction with the `@Service` annotation. The annotation can be used on test classes or on individual test methods. If used on test classes injection of constructor parameters is supported in addition to injection of method parameters.
Note: the implementation relies on calling `FrameworkUtil.getBundle(Class)` with the test class in order to gain access to the world of OSGi.