Package org.springframework.cache.annotation

Examples of org.springframework.cache.annotation.Cacheable


                break;
            }
        }
        assertTrue("TeamService is advised, but does not have caching advisor", hasCachingAdvisor);
        ReflectionUtils.doWithMethods(TeamService.class, method -> {
            Cacheable cacheable = AnnotationUtils.findAnnotation(method, Cacheable.class);
            String methodName = method.getName();
            if (methodName.equals("fetchMemberProfileUsername") || methodName.equals("fetchActiveMembers")) {
                assertNotNull("Method " + methodName + " was expected to have Cacheable annotation.", cacheable);
                String[] cacheName = cacheable.value();
                assertThat(cacheName[0], equalTo(DatabaseConfig.CACHE_NAME));
            } else {
                assertNull("Method " + methodName + " was not expected to have Cacheable annotation.", cacheable);
            }
        });
View Full Code Here


                break;
            }
        }
        assertTrue("BlogService is advised, but does not have caching advisor", hasCachingAdvisor);
        ReflectionUtils.doWithMethods(BlogService.class, (method) -> {
                Cacheable cacheable = AnnotationUtils.findAnnotation(method, Cacheable.class);
                String methodName = method.getName();
                if (methodName.matches("^get.*Published.*$")) {
                    assertNotNull("Method " + methodName + " was expected to have Cacheable annotation.", cacheable);
                    String[] cacheName = cacheable.value();
                    assertThat(cacheName[0], equalTo(DatabaseConfig.CACHE_NAME));
                } else {
                    assertNull("Method " + methodName + " was not expected to have Cacheable annotation.", cacheable);
                }
            });
View Full Code Here

TOP

Related Classes of org.springframework.cache.annotation.Cacheable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.