    @Test
    public void testIsEmailUnique() throws Exception {

        log.info("Testing UserController.isEmailUnique...");

        // set up mock object
        given(userRepository.isEmailUnique(UNIQUE_EMAIL)).willReturn(true);
        given(userRepository.isEmailUnique(EXISTING_EMAIL)).willReturn(false);

        log.info("First we expect a unique email");
        this.mockMvc.perform(get("/api/user/uniqueemail").param("key", UNIQUE_EMAIL).accept(ApplicationMediaType.APPLICATION_BEARCHOKE_V1_JSON))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(content().contentType(ApplicationMediaType.APPLICATION_BEARCHOKE_V1_JSON))
                .andExpect(jsonPath("$.unique").value(true));

        log.info("And now we expect email to already exist");
        this.mockMvc.perform(get("/api/user/uniqueemail").param("key", EXISTING_EMAIL).accept(ApplicationMediaType.APPLICATION_BEARCHOKE_V1_JSON))
                .andDo(print())
                .andExpect(status().isOk())
                .andExpect(content().contentType(ApplicationMediaType.APPLICATION_BEARCHOKE_V1_JSON))
                .andExpect(jsonPath("$.unique").value(false));

        log.info("Testing UserController.isEmailUnique SUCCESSFUL");
    }