Class JsonPipelineContext

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    @ProviderType
    public final class JsonPipelineContext
    extends org.junit.rules.ExternalResource
    JUnit rule for setting up a OSGi-based context with JsonPipelineFactory support.
    • Constructor Detail

      • JsonPipelineContext

        public JsonPipelineContext​(org.apache.sling.testing.mock.osgi.context.OsgiContextImpl osgiContext)
        Parameters:
        osgiContext - OSGi context
    • Method Detail

      • before

        protected void before()
        Overrides:
        before in class org.junit.rules.ExternalResource
      • getMetricRegistry

        public com.codahale.metrics.MetricRegistry getMetricRegistry()
        Returns:
        Mocked Metrics registry
      • getCacheAdapter

        public InMemoryCacheAdapter getCacheAdapter()
        Returns:
        Returns the cacheAdapter.
      • getJsonPipelineFactory

        public io.wcm.caravan.pipeline.JsonPipelineFactory getJsonPipelineFactory()
        Returns:
        JSON pipeline factory
      • loadJson

        public JsonFixture loadJson​(String classpathResource)
        Load a JSON fixture from classpath.
        Parameters:
        classpathResource - Resource path in classpath
        Returns:
        JsonFixture item