@Test
public void should_respond_500_when_error_appear_while_saving_property() throws Exception {

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