@Test
public void should_not_allow_to_create_a_widget_with_an_empty_name() throws Exception {

    Widget customLabel = aWidget().name("").custom().build();
    when(widgetRepository.create(customLabel)).thenThrow(new IllegalArgumentException());
    mockMvc
            .perform(post("/rest/widgets")
                    .contentType(MediaType.APPLICATION_JSON_VALUE)
                    .content(convertObjectToJsonBytes(customLabel)))
            .andExpect(status().isBadRequest());
}