public void getByUrl(){
String widgetUrl = "www.test.com";
Widget widget = new WidgetImpl();
widget.setUrl(widgetUrl);
expect(template.findOne(new Query(where("url").is(widgetUrl)))).andReturn(widget);
replay(template);
Widget result = repo.getByUrl(widgetUrl);
assertThat(result, is(equalTo(widget)));
assertThat(result.getUrl(), is(equalTo(widgetUrl)));