Package org.apache.sling.testing.resourceresolver

# Class MockResourceResolverFactory

java.lang.Object
org.apache.sling.testing.resourceresolver.MockResourceResolverFactory

All Implemented Interfaces:
  `org.apache.sling.api.resource.ResourceResolverFactory`

public class MockResourceResolverFactory extends Object implements org.apache.sling.api.resource.ResourceResolverFactory
Simple resource resolver factory

## Field Summary

### Fields inherited from interface org.apache.sling.api.resource.ResourceResolverFactory

`NEW_PASSWORD, PASSWORD, SUBSERVICE, USER, USER_IMPERSONATION`

## Constructor Summary

Constructors
Constructor
Description
`MockResourceResolverFactory()`
Create a new resource resolver factory.
`MockResourceResolverFactory(@NotNull MockResourceResolverFactoryOptions options)`
Create a new resource resolver factory.
`MockResourceResolverFactory(@Nullable org.osgi.service.event.EventAdmin eventAdmin)`
Create a new resource resolver factory

## Method Summary

Modifier and Type
Method
Description
`void`
`closed(@NotNull org.apache.sling.api.resource.ResourceResolver resolver)`
Inform about a closed resource resolver.
`@NotNull org.apache.sling.api.resource.ResourceResolver`
`getAdministrativeResourceResolver(Map<String,Object> authenticationInfo)`
`@NotNull org.apache.sling.api.resource.ResourceResolver`
`getResourceResolver(Map<String,Object> authenticationInfo)`
`@NotNull List<String>`
`getSearchPath()`
`@NotNull org.apache.sling.api.resource.ResourceResolver`
`getServiceResourceResolver(Map<String,Object> authenticationInfo)`
`org.apache.sling.api.resource.ResourceResolver`
`getThreadResourceResolver()`

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

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

## Constructor Details

### MockResourceResolverFactory

public MockResourceResolverFactory(@Nullable @Nullable org.osgi.service.event.EventAdmin eventAdmin)
Create a new resource resolver factory

Parameters:
  `eventAdmin` - All resource events are sent to this event admin

### MockResourceResolverFactory

public MockResourceResolverFactory()
Create a new resource resolver factory.

### MockResourceResolverFactory

public MockResourceResolverFactory(@NotNull @NotNull MockResourceResolverFactoryOptions options)
Create a new resource resolver factory.

Parameters:
  `options` - Options

## Method Details

### getResourceResolver

@NotNull public @NotNull org.apache.sling.api.resource.ResourceResolver getResourceResolver(Map<String,Object> authenticationInfo) throws org.apache.sling.api.resource.LoginException

Specified by:
  `getResourceResolver` in interface `org.apache.sling.api.resource.ResourceResolverFactory`
Throws:
  `org.apache.sling.api.resource.LoginException`

### getAdministrativeResourceResolver

@NotNull public @NotNull org.apache.sling.api.resource.ResourceResolver getAdministrativeResourceResolver(Map<String,Object> authenticationInfo) throws org.apache.sling.api.resource.LoginException

Specified by:
  `getAdministrativeResourceResolver` in interface `org.apache.sling.api.resource.ResourceResolverFactory`
Throws:
  `org.apache.sling.api.resource.LoginException`

### getServiceResourceResolver

@NotNull public @NotNull org.apache.sling.api.resource.ResourceResolver getServiceResourceResolver(Map<String,Object> authenticationInfo) throws org.apache.sling.api.resource.LoginException

Specified by:
  `getServiceResourceResolver` in interface `org.apache.sling.api.resource.ResourceResolverFactory`
Throws:
  `org.apache.sling.api.resource.LoginException`

### getThreadResourceResolver

public org.apache.sling.api.resource.ResourceResolver getThreadResourceResolver()

Specified by:
  `getThreadResourceResolver` in interface `org.apache.sling.api.resource.ResourceResolverFactory`

### closed

public void closed(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resolver)
Inform about a closed resource resolver. Make sure to remove it from the current thread context.

Parameters:
  `resolver` - Resource resolver

### getSearchPath

@NotNull public @NotNull List<String> getSearchPath()

Specified by:
  `getSearchPath` in interface `org.apache.sling.api.resource.ResourceResolverFactory`