bindName();
AtomicBoolean beanLevelValidationRun = new AtomicBoolean();
- binder.withValidator(Validator.<Person> from(
+ binder.withValidator(Validator.from(
bean -> beanLevelValidationRun.getAndSet(true), ""));
ageField.setValue("not a number");
bindName();
AtomicBoolean beanLevelValidationRun = new AtomicBoolean();
- binder.withValidator(Validator.<Person> from(
+ binder.withValidator(Validator.from(
bean -> beanLevelValidationRun.getAndSet(true), ""));
ageField.setValue(String.valueOf(12));
Person::setFirstName);
String msg = "foo";
- binder.withValidator(Validator.<Person> from(
+ binder.withValidator(Validator.from(
prsn -> prsn.getAddress() != null || prsn.getEmail() != null,
msg));
@Test
public void fireEvent_noException_eventReceived() {
- listener.componentEvent(EasyMock.<Component.Event> anyObject());
+ listener.componentEvent(EasyMock.anyObject());
EasyMock.replay(component, listener, errorHandler);
router.fireEvent(new Component.Event(component), errorHandler);
@Test
public void fireEvent_exceptionFromListenerAndNoHandler_exceptionPropagated() {
- listener.componentEvent(EasyMock.<Component.Event> anyObject());
+ listener.componentEvent(EasyMock.anyObject());
EasyMock.expectLastCall()
.andThrow(new RuntimeException("listener failed"));
@Test
public void fireEvent_exceptionFromListener_errorHandlerCalled() {
- listener.componentEvent(EasyMock.<Component.Event> anyObject());
+ listener.componentEvent(EasyMock.anyObject());
EasyMock.expectLastCall()
.andThrow(new RuntimeException("listener failed"));
- errorHandler.error(EasyMock.<ErrorEvent> anyObject());
+ errorHandler.error(EasyMock.anyObject());
EasyMock.replay(component, listener, errorHandler);
router.fireEvent(new Component.Event(component), errorHandler);
router.addListener(Component.Event.class, listener2,
COMPONENT_EVENT_METHOD);
- listener.componentEvent(EasyMock.<Component.Event> anyObject());
+ listener.componentEvent(EasyMock.anyObject());
EasyMock.expectLastCall()
.andThrow(new RuntimeException("listener failed"));
- errorHandler.error(EasyMock.<ErrorEvent> anyObject());
+ errorHandler.error(EasyMock.anyObject());
// second listener should be called despite an error in the first
- listener2.componentEvent(EasyMock.<Component.Event> anyObject());
+ listener2.componentEvent(EasyMock.anyObject());
EasyMock.replay(component, listener, listener2, errorHandler);
router.fireEvent(new Component.Event(component), errorHandler);