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

## Interface Instance

All Superinterfaces:
  `BuilderCustomizer`, `org.junit.rules.TestRule`

All Known Implementing Classes:
  `AbstractInstance`, `ExistingInstance`

    public interface Instance
    extends org.junit.rules.TestRule, BuilderCustomizer

### Method Summary

All Methods Instance Methods Abstract Methods
`org.apache.sling.testing.clients.SlingClient` `getAdminClient()` Return a new client pointing to the instance corresponding to this {{AbstractInstance}}, with the admin user and password, if it was not previously created, or the existing client if it has been created before See `InstanceSetup.INSTANCE_CONFIG_ADMINUSER` and `InstanceSetup.INSTANCE_CONFIG_ADMINPASSWORD`

`<T extends org.apache.sling.testing.clients.SlingClient>
T`

`getAdminClient​(Class<T> clientClass)`

Return a new client pointing to the instance corresponding to this {{AbstractInstance}}, with the admin user and password, if it was not previously created, or the existing client if it has been created before See `InstanceSetup.INSTANCE_CONFIG_ADMINUSER` and `InstanceSetup.INSTANCE_CONFIG_ADMINPASSWORD`

`<T extends org.apache.sling.testing.clients.SlingClient> T` `getClient​(Class<T> clientClass, String user, String pass)` Return a new client pointing to the instance corresponding to this {{AbstractInstance}} if it was never created with this username and password, or the existing client if it has been created before
`org.apache.sling.testing.clients.instance.InstanceConfiguration` `getConfiguration()`
`org.apache.sling.testing.clients.SlingClient` `newAdminClient​(BuilderCustomizer... customizers)` Return a new client pointing to the instance corresponding to this {{AbstractInstance}}, replacing the internally-cached client with this username and password See `InstanceSetup.INSTANCE_CONFIG_ADMINUSER` and `InstanceSetup.INSTANCE_CONFIG_ADMINPASSWORD`
`<T extends org.apache.sling.testing.clients.SlingClient> T` `newClient​(Class<T> clientClass, String user, String pass, BuilderCustomizer... customizers)` Return a new client pointing to the instance corresponding to this {{AbstractInstance}}, replacing the internally-cached client with this username and password
`Instance` `orDefault​(org.apache.sling.testing.clients.instance.InstanceConfiguration instanceConfiguration)`
`Instance` `withRunMode​(String runMode)`

### Methods inherited from interface org.apache.sling.testing.junit.rules.instance.BuilderCustomizer

`customize`

### Methods inherited from interface org.junit.rules.TestRule

`apply`

### Method Detail

#### withRunMode

    Instance withRunMode​(String runMode)

#### orDefault

    Instance orDefault​(org.apache.sling.testing.clients.instance.InstanceConfiguration instanceConfiguration)

#### getConfiguration

    org.apache.sling.testing.clients.instance.InstanceConfiguration getConfiguration()

#### getClient

    <T extends org.apache.sling.testing.clients.SlingClient> T getClient​(Class<T> clientClass,
                                                                         String user,
                                                                         String pass)

Return a new client pointing to the instance corresponding to this {{AbstractInstance}} if it was never created with this username and password, or the existing client if it has been created before

Type Parameters:
  `T` - the type of the returned client
Parameters:
  `clientClass` - the class of the returned client
  `user` - the username used in the client
  `pass` - the password used in the client
Returns:
  a new client extending {{SlingClient}}

#### getAdminClient

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

Return a new client pointing to the instance corresponding to this {{AbstractInstance}}, with the admin user and password, if it was not previously created, or the existing client if it has been created before See `InstanceSetup.INSTANCE_CONFIG_ADMINUSER` and `InstanceSetup.INSTANCE_CONFIG_ADMINPASSWORD`

Returns:
  a new {{SlingClient}}

#### getAdminClient

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

Return a new client pointing to the instance corresponding to this {{AbstractInstance}}, with the admin user and password, if it was not previously created, or the existing client if it has been created before See `InstanceSetup.INSTANCE_CONFIG_ADMINUSER` and `InstanceSetup.INSTANCE_CONFIG_ADMINPASSWORD`

Type Parameters:
  `T` - the class of the returned client
Parameters:
  `clientClass` - the class of the returned client
Returns:
  a new client extending on {{SlingClient}}

#### newClient

    <T extends org.apache.sling.testing.clients.SlingClient> T newClient​(Class<T> clientClass,
                                                                         String user,
                                                                         String pass,
                                                                         BuilderCustomizer... customizers)

Return a new client pointing to the instance corresponding to this {{AbstractInstance}}, replacing the internally-cached client with this username and password

Type Parameters:
  `T` - the type of the returned client
Parameters:
  `clientClass` - the class of the returned client
  `user` - the username used in the client
  `pass` - the password used in the client
  `customizers` - array of customizers for this client
Returns:
  a new client extending {{SlingClient}}

#### newAdminClient

    org.apache.sling.testing.clients.SlingClient newAdminClient​(BuilderCustomizer... customizers)

Return a new client pointing to the instance corresponding to this {{AbstractInstance}}, replacing the internally-cached client with this username and password See `InstanceSetup.INSTANCE_CONFIG_ADMINUSER` and `InstanceSetup.INSTANCE_CONFIG_ADMINPASSWORD`

Parameters:
  `customizers` - array of customizers for this client
Returns:
  a new {{SlingClient}}