#389 - Polishing.
Add author tags. Reformat code. Original pull request: #412.
This commit is contained in:
@@ -24,11 +24,12 @@ import org.springframework.data.repository.CrudRepository;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
* @author Andrea Rizzini
|
||||
*/
|
||||
public interface CachingUserRepository extends CrudRepository<User, Long> {
|
||||
|
||||
@Override
|
||||
@CacheEvict(value="byUsername", key="#p0.username")
|
||||
@CacheEvict(value = "byUsername", key = "#p0.username")
|
||||
<S extends User> S save(S entity);
|
||||
|
||||
@Cacheable("byUsername")
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
* @author Andrea Rizzini
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@Transactional
|
||||
@@ -56,13 +57,12 @@ public class CachingRepositoryTests {
|
||||
assertThat(cache.get("dmatthews").get()).isEqualTo(dave);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void checkCacheEviction() {
|
||||
|
||||
User dave = new User();
|
||||
dave.setUsername("dmatthews");
|
||||
dave = repository.save(dave);
|
||||
repository.save(dave);
|
||||
|
||||
// Verify entity evicted on cache
|
||||
Cache cache = cacheManager.getCache("byUsername");
|
||||
|
||||
Reference in New Issue
Block a user