Annotation Interface AutoConfigureCache


@Target(TYPE) @Retention(RUNTIME) @Documented @Inherited @ImportAutoConfiguration public @interface AutoConfigureCache
Annotation that can be applied to a test class to customize the cache provider. By default, a NoOpCacheManager is auto-configured

As for the regular auto-configuration, this has no effect if a custom CacheManager is defined.

Since:
1.4.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    org.springframework.boot.autoconfigure.cache.CacheType
    The CacheType to configure, overriding the behavior for testing purposes.
  • Element Details

    • cacheProvider

      @PropertyMapping("spring.cache.type") org.springframework.boot.autoconfigure.cache.CacheType cacheProvider
      The CacheType to configure, overriding the behavior for testing purposes.
      Returns:
      the cache type to configure
      Default:
      NONE