-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Hi,
It comes out there is an issue if you are using Lombok annotation @Accessors(chain = true).
Tests couldn't pass and give the following error:
bean with valid setter and getter methods for all properties bean of type "..." had an invalid getter/setter for the property "..."
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class KeyValue {
private String key;
private String value;
}If remove it - then everything works just fine.
But I hope there is possibility to add some extra options or settings, so it could also work with this annotation.
Thanks!
simple test itself
import static com.google.code.beanmatchers.BeanMatchers.*;
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.MatcherAssert.assertThat;
class KVTest {
@Test
void testBean() {
assertThat(KeyValue.class, allOf(
hasValidBeanConstructor(),
hasValidGettersAndSetters(),
hasValidBeanHashCode(),
hasValidBeanEquals(),
hasValidBeanToString()
));
}
}PS.
only one assertion works so far... ((
@Test
void testBean() {
assertThat(KeyValue.class, allOf(
hasValidBeanConstructor()
// hasValidGettersAndSetters(),
// hasValidBeanHashCode(),
// hasValidBeanEquals(),
// hasValidBeanToString()
));
}these three hasValidBeanHashCode(), hasValidBeanEquals(), hasValidBeanToString()
produce com.google.code.beanmatchers.AccessorMissingException: missing setter for the property key
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels