@Test
public void updateTag() throws Exception {

    // TODO test with update and creation with an anonymous user
    MetadataCategory category = _categoriesRepo.findOne(1);
    Assert.assertNotNull(category);
    category.setName(category.getName() + "-2");
    Gson gson = new GsonBuilder()
        .setFieldNamingStrategy(new JsonFieldNamingStrategy())
        .setExclusionStrategies(new FieldNameExclusionStrategy("_labelTranslations", "_records"))
        .create();
    String json = gson.toJson(category);
    this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
    this.mockMvc.perform(put("/srv/api/tags/" + category.getId())
        .content(json)
        .contentType(API_JSON_EXPECTED_ENCODING)
        .accept(MediaType.parseMediaType("application/json")))
        .andExpect(status().is(204));
}