@Test
public void should_respond_404_when_widget_or_property_not_found_while_updating_property() throws Exception {

    when(widgetService.updateProperty(eq("label"), eq("toBeUpdated"), any(Property.class))).thenThrow(NotFoundException.class);
    mockMvc.perform(put("/rest/widgets/label/properties/toBeUpdated")
            .contentType(MediaType.APPLICATION_JSON_VALUE)
            .content(convertObjectToJsonBytes(aProperty().build())))
            .andExpect(status().isNotFound());
}