Package org.apache.sling.commons.testing.sling

# Class MockResource

java.lang.Object
org.apache.sling.api.adapter.SlingAdaptable
org.apache.sling.api.resource.AbstractResource
org.apache.sling.api.resource.SyntheticResource
org.apache.sling.commons.testing.sling.MockResource

All Implemented Interfaces:
  `org.apache.sling.api.adapter.Adaptable`, `org.apache.sling.api.resource.Resource`

public class MockResource extends org.apache.sling.api.resource.SyntheticResource

## Field Summary

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

`RESOURCE_TYPE_NON_EXISTING`

## Constructor Summary

Constructors
Constructor
Description
`MockResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path, String resourceType)`
`MockResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path, String resourceType, String resourceSuperType)`

## Method Summary

Modifier and Type
Method
Description
`<AdapterType>
AdapterType`
`adaptTo(Class<AdapterType> type)`
`void`
`addProperty(String key, Object value)`
`Map<String,Object>`
`getProperties()`
`String`
`getResourceSuperType()`
`String`
`getResourceType()`
`void`
`setResourceSuperType(String resourceSuperType)`
`void`
`setResourceType(String resourceType)`

### Methods inherited from class org.apache.sling.api.resource.SyntheticResource

`getPath, getResourceMetadata, getResourceResolver, toString`

### Methods inherited from class org.apache.sling.api.resource.AbstractResource

`getChild, getChildren, getName, getParent, getValueMap, hasChildren, isResourceType, listChildren`

### Methods inherited from class org.apache.sling.api.adapter.SlingAdaptable

`setAdapterManager, unsetAdapterManager`

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

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

## Constructor Details

### MockResource

public MockResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path, String resourceType)

### MockResource

public MockResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path, String resourceType, String resourceSuperType)

## Method Details

### addProperty

public void addProperty(String key, Object value)

### getProperties

public Map<String,Object> getProperties()

### getResourceType

public String getResourceType()

Specified by:
  `getResourceType` in interface `org.apache.sling.api.resource.Resource`
Overrides:
  `getResourceType` in class `org.apache.sling.api.resource.SyntheticResource`

### setResourceType

public void setResourceType(String resourceType)

### getResourceSuperType

public String getResourceSuperType()

Specified by:
  `getResourceSuperType` in interface `org.apache.sling.api.resource.Resource`
Overrides:
  `getResourceSuperType` in class `org.apache.sling.api.resource.SyntheticResource`

### setResourceSuperType

public void setResourceSuperType(String resourceSuperType)

### adaptTo

public <AdapterType> AdapterType adaptTo(Class<AdapterType> type)

Specified by:
  `adaptTo` in interface `org.apache.sling.api.adapter.Adaptable`
Overrides:
  `adaptTo` in class `org.apache.sling.api.adapter.SlingAdaptable`