@Test
  public void allowsPostRequestForAdmin() throws Exception {

    HttpHeaders headers = new HttpHeaders();
    headers.set(HttpHeaders.ACCEPT, MediaTypes.HAL_JSON_VALUE);
    headers.set(
        HttpHeaders.AUTHORIZATION,
        "Basic " + new String(Base64.encode(("ollie:gierke").getBytes())));

    mvc.perform(
            get("/employees")
                . //
                headers(headers))
        . //
        andExpect(content().contentTypeCompatibleWith(MediaTypes.HAL_JSON))
        . //
        andExpect(status().isOk())
        . //
        andDo(print());

    headers.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);

    String location =
        mvc.perform(
                post("/employees")
                    . //
                    content(PAYLOAD)
                    . //
                    headers(headers))
            . //
            andExpect(status().isCreated())
            . //
            andDo(print())
            . //
            andReturn()
            .getResponse()
            .getHeader(HttpHeaders.LOCATION);

    ObjectMapper mapper = new ObjectMapper();

    String content =
        mvc.perform(get(location))
            . //
            andReturn()
            .getResponse()
            .getContentAsString();
    Employee employee = mapper.readValue(content, Employee.class);

    assertThat(employee.getFirstName(), is("Saruman"));
    assertThat(employee.getLastName(), is("the White"));
    assertThat(employee.getTitle(), is("Wizard"));
  }