@Test
public void updateSource() throws Exception {

    Source source = sourceRepo.findOneByName("source-test");
    Assert.assertNotNull(source);
    source.setName("source-test-updated");
    Gson gson = new GsonBuilder()
        .setFieldNamingStrategy(new JsonFieldNamingStrategy())
        .setExclusionStrategies(new FieldNameExclusionStrategy("_labelTranslations", "creationDate"))
        .create();
    String json = gson.toJson(source);
    this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
    this.mockHttpSession = loginAsAdmin();
    this.mockMvc.perform(put("/srv/api/sources/" + source.getUuid())
        .content(json)
        .contentType(API_JSON_EXPECTED_ENCODING)
        .session(this.mockHttpSession)
        .accept(MediaType.parseMediaType("text/plain")))
        .andExpect(status().is(204));
}