import org.apache.isis.core.metamodel.facets.properties.notpersisted.annotation.NotPersistedFacetOnPropertyAnnotation;
public class NotPersistedAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
public void testNotPersistedAnnotationPickedUpOnProperty() {
final NotPersistedFacetOnPropertyAnnotationFactory facetFactory = new NotPersistedFacetOnPropertyAnnotationFactory();
class Customer {
@SuppressWarnings("unused")
@NotPersisted()
public String getFirstName() {
return null;
}
}
final Method method = findMethod(Customer.class, "getFirstName");
facetFactory.process(new ProcessMethodContext(Customer.class, null, null, method, methodRemover, facetedMethod));
final Facet facet = facetedMethod.getFacet(NotPersistedFacet.class);
assertNotNull(facet);
assertTrue(facet instanceof NotPersistedFacetOnPropertyAnnotation);