Interface CachingFTUtil<E extends dev.daymor.sakuraboot.DataPresentation<I>,I extends Comparable<? super I> & Serializable>
- Type Parameters:
E
- The entity typeDataPresentation
.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:
-
Field Summary
Fields inherited from interface dev.daymor.sakuraboot.test.functional.SuperFTUtil
CAMEL_CASE_PATTERN
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Assert that the cache is created.org.springframework.cache.CacheManager
Get the cache manager.default String[]
Return an array of string containing the name of the different cache.Methods inherited from interface dev.daymor.sakuraboot.test.BasicTestUtil
getDifferentEntity, getEntity, getEntityClass, getEntityWithoutId, getPartialEntity, getSecondEntity
Methods inherited from interface dev.daymor.sakuraboot.test.functional.SuperFTUtil
createValidationErrorEntity, getBiggerValidId, getControllerPackageName, getDtoPackageName, getEntityPackageName, getGlobalSpecification, getInvalidId, getMapperPackageName, getPath, getServicePackageName, getValidId
Methods inherited from interface dev.daymor.sakuraboot.test.SuperITUtil
getDifferentEntityWithId, getPartialEntityWithId
-
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
Return an array of string containing the name of the different cache.- Returns:
- An array of cache name.
-