Class MockResource

java.lang.Object
org.apache.sling.api.adapter.SlingAdaptable
org.apache.sling.api.resource.AbstractResource
org.apache.sling.testing.resourceresolver.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.AbstractResource
  • Field Summary

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

    RESOURCE_TYPE_NON_EXISTING
  • Constructor Summary

    Constructors
    Constructor
    Description
    MockResource(String path, Map<String,Object> props, org.apache.sling.api.resource.ResourceResolver resolver)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <AdapterType>
    AdapterType
    adaptTo(Class<AdapterType> type)
     
    @NotNull String
     
    @NotNull org.apache.sling.api.resource.ResourceMetadata
     
    @NotNull org.apache.sling.api.resource.ResourceResolver
     
     
    @NotNull String
     
    org.apache.sling.api.resource.ValueMap
     
     

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

    getChild, getChildren, getName, getParent, 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(String path, Map<String,Object> props, org.apache.sling.api.resource.ResourceResolver resolver)
  • Method Details

    • getPath

      @NotNull public @NotNull String getPath()
    • getResourceType

      @NotNull public @NotNull String getResourceType()
    • getResourceSuperType

      public String getResourceSuperType()
    • getResourceMetadata

      @NotNull public @NotNull org.apache.sling.api.resource.ResourceMetadata getResourceMetadata()
    • getResourceResolver

      @NotNull public @NotNull org.apache.sling.api.resource.ResourceResolver getResourceResolver()
    • 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
    • getValueMap

      public org.apache.sling.api.resource.ValueMap getValueMap()
      Specified by:
      getValueMap in interface org.apache.sling.api.resource.Resource
      Overrides:
      getValueMap in class org.apache.sling.api.resource.AbstractResource
    • toString

      public String toString()
      Overrides:
      toString in class Object