@Test
public void updateMapserver() throws Exception {

    MapServer mapServerToUpdate = mapServerRepo.findAll().get(0);
    Assert.assertNotNull(mapServerToUpdate);
    mapServerToUpdate.setName(mapServerToUpdate.getName() + "-update");
    Gson gson = new GsonBuilder()
        .setFieldNamingStrategy(new JsonFieldNamingStrategy())
        .setExclusionStrategies(new FieldNameExclusionStrategy("_pushstyleinworkspace"))
        .create();
    String json = gson.toJson(mapServerToUpdate);
    this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
    this.mockHttpSession = loginAsAdmin();
    this.mockMvc.perform(put("/srv/api/mapservers/" + mapServerToUpdate.getId())
        .content(json)
        .contentType(API_JSON_EXPECTED_ENCODING)
        .session(this.mockHttpSession)
        .accept(MediaType.parseMediaType("application/json")))
        .andExpect(status().is(204));
}