Package org.apache.sling.junit.rules

# Class OSGiService<T>

java.lang.Object
org.apache.sling.junit.rules.Service
org.apache.sling.junit.rules.OSGiService<T>

All Implemented Interfaces:
  `org.junit.rules.TestRule`

public class OSGiService<T> extends Service
Improved variant of the Service class that uses generics. The {#link TeleporterRule} also provides access to OSGi services for server-side tests, in a more integrated way.

## Method Summary

Modifier and Type
Method
Description
`T`
`get()`
`static <T> OSGiService<T>`
`ofClass(Class<T> clazz)`

### Methods inherited from class org.apache.sling.junit.rules.Service

`apply, getService`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### ofClass

public static <T> OSGiService<T> ofClass(Class<T> clazz)

### get

public T get()