Class MockCAConfig


  • @ProviderType
    public final class MockCAConfig
    extends Object
    Helps setting up a mock environment for wcm.io Configuration.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void contextPathStrategyAbsoluteParent​(@NotNull io.wcm.testing.mock.aem.context.AemContextImpl context, int... levels)
      Register ContextPathStrategy that supports one or multiple fixed levels in content hierarchy where configurations are supported.
      static void contextPathStrategyRootTemplate​(@NotNull io.wcm.testing.mock.aem.context.AemContextImpl context, String... templatePaths)
      Register ContextPathStrategy that detects context paths by matching parent pages against a list of allowed templates for context root.
      static void writeConfiguration​(@NotNull io.wcm.testing.mock.aem.context.AemContextImpl context, @NotNull String contextPath, @NotNull String configName, @NotNull Object @NotNull ... values)
      Deprecated.
      Please use MockContextAwareConfig.writeConfiguration(org.apache.sling.testing.mock.sling.context.SlingContextImpl, String, String, Object[])
      static void writeConfiguration​(@NotNull io.wcm.testing.mock.aem.context.AemContextImpl context, @NotNull String contextPath, @NotNull String configName, @NotNull Map<String,​Object> values)
      Deprecated.
      Please use MockContextAwareConfig.writeConfiguration(org.apache.sling.testing.mock.sling.context.SlingContextImpl, String, String, Map)
      static void writeConfigurationCollection​(@NotNull io.wcm.testing.mock.aem.context.AemContextImpl context, @NotNull String contextPath, @NotNull String configName, @NotNull Collection<Map<String,​Object>> values)
      Deprecated.
      Please use MockContextAwareConfig.writeConfigurationCollection(org.apache.sling.testing.mock.sling.context.SlingContextImpl, String, String, Collection)
    • Method Detail

      • contextPathStrategyAbsoluteParent

        public static void contextPathStrategyAbsoluteParent​(@NotNull
                                                             @NotNull io.wcm.testing.mock.aem.context.AemContextImpl context,
                                                             int... levels)
        Register ContextPathStrategy that supports one or multiple fixed levels in content hierarchy where configurations are supported.
        Parameters:
        context - AEM context
        levels - List of absolute levels where configuration is supported. Levels are used in the same way as Text.getAbsoluteParent(String, int). Example:
        Text.getAbsoluteParent("/foo/bar/test", 1) == "/foo/bar"
      • contextPathStrategyRootTemplate

        public static void contextPathStrategyRootTemplate​(@NotNull
                                                           @NotNull io.wcm.testing.mock.aem.context.AemContextImpl context,
                                                           String... templatePaths)
        Register ContextPathStrategy that detects context paths by matching parent pages against a list of allowed templates for context root.
        Parameters:
        context - AEM context
        templatePaths - List of template paths allowed for context root pages.
      • writeConfiguration

        @Deprecated
        public static void writeConfiguration​(@NotNull
                                              @NotNull io.wcm.testing.mock.aem.context.AemContextImpl context,
                                              @NotNull
                                              @NotNull String contextPath,
                                              @NotNull
                                              @NotNull String configName,
                                              @NotNull
                                              @NotNull Map<String,​Object> values)
        Deprecated.
        Please use MockContextAwareConfig.writeConfiguration(org.apache.sling.testing.mock.sling.context.SlingContextImpl, String, String, Map)
        Writes configuration parameters using the primary configured persistence provider.
        Parameters:
        context - AEM context
        contextPath - Configuration id
        configName - Config name
        values - Configuration values
      • writeConfiguration

        @Deprecated
        public static void writeConfiguration​(@NotNull
                                              @NotNull io.wcm.testing.mock.aem.context.AemContextImpl context,
                                              @NotNull
                                              @NotNull String contextPath,
                                              @NotNull
                                              @NotNull String configName,
                                              @NotNull
                                              @NotNull Object @NotNull ... values)
        Deprecated.
        Please use MockContextAwareConfig.writeConfiguration(org.apache.sling.testing.mock.sling.context.SlingContextImpl, String, String, Object[])
        Writes configuration parameters using the primary configured persistence provider.
        Parameters:
        context - AEM context
        contextPath - Configuration id
        configName - Config name
        values - Configuration values
      • writeConfigurationCollection

        @Deprecated
        public static void writeConfigurationCollection​(@NotNull
                                                        @NotNull io.wcm.testing.mock.aem.context.AemContextImpl context,
                                                        @NotNull
                                                        @NotNull String contextPath,
                                                        @NotNull
                                                        @NotNull String configName,
                                                        @NotNull
                                                        @NotNull Collection<Map<String,​Object>> values)
        Deprecated.
        Please use MockContextAwareConfig.writeConfigurationCollection(org.apache.sling.testing.mock.sling.context.SlingContextImpl, String, String, Collection)
        Writes a collection of configuration parameters using the primary configured persistence provider.
        Parameters:
        context - AEM context
        contextPath - Configuration id
        configName - Config name
        values - Configuration values