Class MockComponentContext

java.lang.Object
io.wcm.testing.mock.aem.MockComponentContext
All Implemented Interfaces:
com.day.cq.wcm.api.components.ComponentContext

public final class MockComponentContext extends Object implements com.day.cq.wcm.api.components.ComponentContext
Mock implementation of ComponentContext.
  • Constructor Details

    • MockComponentContext

      public MockComponentContext(@NotNull @NotNull com.day.cq.wcm.api.Page currentPage, @NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request)
      Parameters:
      currentPage - Current page
      request - Request
  • Method Details

    • getPage

      public com.day.cq.wcm.api.Page getPage()
      Specified by:
      getPage in interface com.day.cq.wcm.api.components.ComponentContext
    • getResource

      public org.apache.sling.api.resource.Resource getResource()
      Specified by:
      getResource in interface com.day.cq.wcm.api.components.ComponentContext
    • getComponent

      public com.day.cq.wcm.api.components.Component getComponent()
      Specified by:
      getComponent in interface com.day.cq.wcm.api.components.ComponentContext
    • getAttribute

      public Object getAttribute(String name)
      Specified by:
      getAttribute in interface com.day.cq.wcm.api.components.ComponentContext
    • setAttribute

      public Object setAttribute(String name, Object value)
      Specified by:
      setAttribute in interface com.day.cq.wcm.api.components.ComponentContext
    • hasDecoration

      public boolean hasDecoration()
      Specified by:
      hasDecoration in interface com.day.cq.wcm.api.components.ComponentContext
    • setDecorate

      public void setDecorate(boolean decorate)
      Specified by:
      setDecorate in interface com.day.cq.wcm.api.components.ComponentContext
    • getDecorationTagName

      public String getDecorationTagName()
      Specified by:
      getDecorationTagName in interface com.day.cq.wcm.api.components.ComponentContext
    • setDecorationTagName

      public void setDecorationTagName(String value)
      Specified by:
      setDecorationTagName in interface com.day.cq.wcm.api.components.ComponentContext
    • getDefaultDecorationTagName

      public String getDefaultDecorationTagName()
      Specified by:
      getDefaultDecorationTagName in interface com.day.cq.wcm.api.components.ComponentContext
    • setDefaultDecorationTagName

      public void setDefaultDecorationTagName(String value)
      Specified by:
      setDefaultDecorationTagName in interface com.day.cq.wcm.api.components.ComponentContext
    • getEditContext

      public com.day.cq.wcm.api.components.EditContext getEditContext()
      Specified by:
      getEditContext in interface com.day.cq.wcm.api.components.ComponentContext
    • getCell

      public com.day.cq.wcm.api.designer.Cell getCell()
      Specified by:
      getCell in interface com.day.cq.wcm.api.components.ComponentContext
    • setCell

      public void setCell(com.day.cq.wcm.api.designer.Cell cell)
      Parameters:
      cell - Cell
    • getCssClassNames

      public Set<String> getCssClassNames()
      Specified by:
      getCssClassNames in interface com.day.cq.wcm.api.components.ComponentContext
    • setCssClassNames

      public void setCssClassNames(Set<String> cssClassNames)
      Parameters:
      cssClassNames - CSS class names
    • getParent

      public com.day.cq.wcm.api.components.ComponentContext getParent()
      Specified by:
      getParent in interface com.day.cq.wcm.api.components.ComponentContext
    • getRoot

      public com.day.cq.wcm.api.components.ComponentContext getRoot()
      Specified by:
      getRoot in interface com.day.cq.wcm.api.components.ComponentContext
    • isRoot

      public boolean isRoot()
      Specified by:
      isRoot in interface com.day.cq.wcm.api.components.ComponentContext
    • getAnalyzeContext

      public com.day.cq.wcm.api.components.AnalyzeContext getAnalyzeContext()
      Specified by:
      getAnalyzeContext in interface com.day.cq.wcm.api.components.ComponentContext