@Test
public void should_get_a_widget_by_its_id() throws Exception {

    Widget input = aWidget().id("input").build();
    when(widgetService.get("input")).thenReturn(input);
    mockMvc.perform(get("/rest/widgets/input"))
            .andExpect(status().isOk())
            .andExpect(content().json(toJson(input)));
}