* @see DATACMNS-282
*/
@Test
public void populatesAnnotationCacheWithDirectAnnotationsOnCreation() {
SamplePersistentProperty property = entity.getPersistentProperty("meta");
// Assert direct annotations are cached on construction
Map<Class<? extends Annotation>, Annotation> cache = getAnnotationCache(property);
assertThat(cache.containsKey(MyAnnotationAsMeta.class), is(true));
assertThat(cache.containsKey(MyAnnotation.class), is(false));
// Assert meta annotation is found and cached
MyAnnotation annotation = property.findAnnotation(MyAnnotation.class);
assertThat(annotation, is(notNullValue()));
assertThat(cache.containsKey(MyAnnotation.class), is(true));
}