assertNotNull("Field error for duplicate url", errors.getFieldError("url"));
}
@Test
public void testValidationFailsOnInvalidUrl() {
Widget widget = new WidgetImpl();
widget.setTitle(VALID_TITLE);
widget.setType(VALID_TYPE);
widget.setUrl("http:/this.is/invalid?url=true&reject=true");
widget.setScreenshotUrl("https://///invalid/screenshot");
widget.setThumbnailUrl("thumbnail");
widget.setTitleUrl("titleUrl");
widget.setDescription(VALID_DESCRIPTION);
Errors errors = new BindException(widget, WIDGET);
widgetValidator.validate(widget, errors);
assertEquals(4, errors.getErrorCount());
assertNotNull("Field error on url", errors.getFieldError("url"));