@Test
public void should_update_a_property_of_a_widget_and_return_the_list_of_properties() throws Exception {

    Property property = aProperty().build();
    List<Property> expectedProperties = asList(property);
    when(widgetService.updateProperty("customLabel", "toBeUpdated", property)).thenReturn(expectedProperties);
    mockMvc.perform(put("/rest/widgets/customLabel/properties/toBeUpdated")
            .contentType(MediaType.APPLICATION_JSON_VALUE)
            .content(convertObjectToJsonBytes(property)))
            .andExpect(status().isOk())
            .andExpect(content().json(toJson(expectedProperties)));
    verify(widgetService).updateProperty("customLabel", "toBeUpdated", property);
}