@Test
public void should_respond_500_when_error_appear_while_updating_property() throws Exception {

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