final PropertyClearFacetViaSetterMethod propertyClearFacet = (PropertyClearFacetViaSetterMethod) facet;
assertEquals(propertySetterMethod, propertyClearFacet.getMethods().get(0));
}
public void testChoicesFacetFoundAndMethodRemoved() {
final PropertyChoicesFacetViaMethodFactory facetFactory = new PropertyChoicesFacetViaMethodFactory();
facetFactory.setSpecificationLookup(reflector);
class Customer {
@SuppressWarnings("unused")
public String getFirstName() {
return null;
}
@SuppressWarnings("unused")
public Object[] choicesFirstName() {
return null;
}
}
final Method propertyAccessorMethod = findMethod(Customer.class, "getFirstName");
final Method propertyChoicesMethod = findMethod(Customer.class, "choicesFirstName");
facetFactory.process(new ProcessMethodContext(Customer.class, null, null, propertyAccessorMethod, methodRemover, facetedMethod));
final Facet facet = facetedMethod.getFacet(PropertyChoicesFacet.class);
assertNotNull(facet);
assertTrue(facet instanceof PropertyChoicesFacetViaMethod);
final PropertyChoicesFacetViaMethod propertyChoicesFacet = (PropertyChoicesFacetViaMethod) facet;