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);
}
});