public void testNotPersistedAnnotationPickedUpOnCollection() {
final NotPersistedAnnotationForCollectionFacetFactory facetFactory = new NotPersistedAnnotationForCollectionFacetFactory();
class Order {
}
class Customer {
@SuppressWarnings("unused")
@NotPersisted()
public Collection<Order> getOrders() {
return null;
}
}
final Method method = findMethod(Customer.class, "getOrders");
facetFactory.process(new ProcessMethodContext(Customer.class, method, methodRemover, facetedMethod));
final Facet facet = facetedMethod.getFacet(NotPersistedFacet.class);
assertNotNull(facet);
assertTrue(facet instanceof NotPersistedFacetAnnotationForCollection);
assertNoMethodsRemoved();
}