@Test
  public void testUpdate() throws Exception {

    // Create item
    Location storedItem = _postMockModel();
    LOG.info("stored item: " + storedItem);

    // Update by id
    String resourcePathWithId = MvcControllerUtil.resourcePathWithId(storedItem);
    storedItem.changeName("a new name");
    String putJsonStr = JackSONUtils.toJSON(storedItem);
    LOG.info("location putJsonStr: " + putJsonStr + " resourcePathWithId: " + resourcePathWithId);
    ResultActions resultActions =
        mockMvc
            .perform(
                put(resourcePathWithId)
                    .content(putJsonStr)
                    .accept(MediaType.APPLICATION_JSON)
                    .contentType(MediaType.APPLICATION_JSON))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.APPLICATION_JSON));

    Location updatedItem = ResultActionsUtil.contentAsJson(resultActions, Location.class);
    Assert.assertEquals(storedItem, updatedItem);
    // debug the result
    ResultActionsUtil.log(resultActions);
  }
  @Test
  public void testRemove() throws Exception {

    // Create item
    Location storedItem = _postMockModel();
    LOG.info("stored item: " + storedItem);

    // Remove by id
    String resourcePathWithId = MvcControllerUtil.resourcePathWithId(storedItem);
    LOG.info("fetch with resourcePathWithId: " + resourcePathWithId);
    ResultActions resultActions =
        mockMvc.perform(delete(resourcePathWithId).accept(MediaType.APPLICATION_JSON));
    resultActions
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON));

    Location removedItem = ResultActionsUtil.contentAsJson(resultActions, Location.class);
    Assert.assertEquals(storedItem, removedItem);

    // debug the result
    // ResultActionsUtil.log(resultActions);
  }