Interface CachingFTUtil<E extends dev.daymor.sakuraboot.DataPresentation<I>,I extends Comparable<? super I> & Serializable>

Type Parameters:
E - The entity type DataPresentation.
I - The ID of type Comparable and Serializable.
All Superinterfaces:
dev.daymor.sakuraboot.test.BasicTestUtil<E,I>, SuperFTUtil<E,I>, dev.daymor.sakuraboot.test.SuperITUtil<E,I>, dev.daymor.sakuraboot.test.SuperTestUtil<I>

public interface CachingFTUtil<E extends dev.daymor.sakuraboot.DataPresentation<I>,I extends Comparable<? super I> & Serializable> extends SuperFTUtil<E,I>
The interface for all the utility functional test function. This interface provides common functions for testing caching class.

Example:

To create a concrete util class that inherits from CachingFTUtil, follow these steps:

Implements the CachingFTUtil interface:

 @Component
 public class YourFTUtil //
     implements CachingFTUtil<YourEntity, YourIdType> {

     private final GlobalSpecification globalSpecification;

     private final CacheManager cacheManager;

     @Autowired
     public YourFTUtil(
         final GlobalSpecification globalSpecification,
         final CacheManager cacheManager) {

         this.globalSpecification = globalSpecification;
         this.cacheManager = cacheManager;
     }

     @Override
     public GlobalSpecification getGlobalSpecification() {

         return globalSpecification;
     }

     @Override
     public Optional<YourEntity> createValidation
     ErrorEntity(YourIdType id) {

         return YourEntity.builder().id(id).build();
         // If your class don't have a builder you can use the constructor
     }

     @Override
     public CacheManager getCacheManager() {

         return cacheManager;
     }
 }
 
Since:
0.1.0
See Also:
  • Method Details

    • getCacheManager

      org.springframework.cache.CacheManager getCacheManager()
      Get the cache manager.
      Returns:
      the cacheManager
    • assertCacheCreated

      default void assertCacheCreated()
      Assert that the cache is created.
    • getCacheNames

      default String[] getCacheNames()
      Return an array of string containing the name of the different cache.
      Returns:
      An array of cache name.