-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
Description
We find ourselves implementing a couple of ValueGenerators when testing a bean class. This leads to boilerplate code due to anonymous classes which could be avoided by passing a Supplier. Unless this test library needs to work with Java < 1.8, of course.
Status quo:
BeanMatchers.registerValueGenerator(new ValueGenerator<Instant>() {
public Instant generate() {
return Instant.now();
}
}, Instant.class);
Using Supplier:
BeanMatchers.registerValueGenerator(Instant::now, Instant.class)
Reactions are currently unavailable