« Return to Thread: Pojo matcher

Re: Pojo matcher

by tricpod :: Rate this Message:

Reply to Author | View in Thread

Hi,

This should work:
one(mocked).method(with(aPropertyValuesAsMatcher(expected)));

@Factory
public Matcher<Entity> aPropertyValuesAsMatcher(
   final Entity expected) {
       return new SamePropertyValuesAs<Entity>(expected);
}

but not this:

one(mocked).method(with(aPropertyValuesAsMatcher(expected)));

@Factory
public Matcher<List<Entity>> aPropertyValuesAsMatcher(
   final List<Entity> expected) {
       return new SamePropertyValuesAs<List<Entity>>(expected);
}

I got
java.lang.NoSuchMethodError:
org.hamcrest.beans.PropertyUtil.propertyDescriptorsFor(Ljava/lang/Object;Ljava/lang/Class;)[Ljava/beans/PropertyDescriptor;
        at org.hamcrest.beans.SamePropertyValuesAs.<init>(SamePropertyValuesAs.java:27)

I know java.util.List is not a Bean ....

wkr Thomas

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Pojo matcher