@Test
public void should_get_a_widget_with_asset_by_its_id() throws Exception {

    Widget input = aWidget().id("input").assets(anAsset().withName("myScopeWidgetAsset").withType(AssetType.CSS))
            .build();
    when(widgetService.get("input")).thenReturn(input);
    mockMvc.perform(get("/rest/widgets/input"))
            .andExpect(status().isOk())
            .andExpect(content().json(toJson(input)))
            .andExpect(jsonPath("assets[*].scope").exists())
            .andExpect(jsonPath("assets[*].scope").value(everyItem(is("widget"))));
}