Package org.apache.sling.testing.junit.rules

## Class SlingInstanceRule

- java.lang.Object
- - org.apache.sling.testing.junit.rules.SlingInstanceRule

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

    public class SlingInstanceRule
    extends Object
    implements org.junit.rules.TestRule

Junit Rule that allows access to a Sling instance. It is wrapped by a `SlingClassRule`

### Field Summary

Fields
`static org.apache.sling.testing.clients.instance.InstanceConfiguration` `DEFAULT_INSTANCE`
`Instance` `defaultInstance` ExistingInstance for default instance
`protected org.junit.rules.TestRule` `ruleChain`
`SlingClassRule` `slingClassRule` Sling rules to be executed at class level

### Constructor Summary

Constructors
`SlingInstanceRule()`

### Method Summary

All Methods Instance Methods Concrete Methods
`org.junit.runners.model.Statement` `apply​(org.junit.runners.model.Statement base, org.junit.runner.Description description)`
`org.apache.sling.testing.clients.SlingClient` `getAdminClient()`
`<T extends org.apache.sling.testing.clients.SlingClient> T` `getAdminClient​(Class<T> clientClass)`

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

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

### Field Detail

#### DEFAULT_INSTANCE

    public static final org.apache.sling.testing.clients.instance.InstanceConfiguration DEFAULT_INSTANCE

#### slingClassRule

    public final SlingClassRule slingClassRule

Sling rules to be executed at class level

#### defaultInstance

    public final Instance defaultInstance

ExistingInstance for default instance

#### ruleChain

    protected org.junit.rules.TestRule ruleChain

### Constructor Detail

#### SlingInstanceRule

    public SlingInstanceRule()

### Method Detail

#### getAdminClient

    public <T extends org.apache.sling.testing.clients.SlingClient> T getAdminClient​(Class<T> clientClass)

#### getAdminClient

    public org.apache.sling.testing.clients.SlingClient getAdminClient()

#### apply

    public org.junit.runners.model.Statement apply​(org.junit.runners.model.Statement base,
                                                   org.junit.runner.Description description)

Specified by:
  `apply` in interface `org.junit.rules.TestRule`