@SneakyThrows
@Test
void createUserTest() {

    UserDTO request = new UserDTO("testUser", "testPassword");
    RestDocumentationResultHandler document = document("user-create-success",
            requestHeaders(headerWithName("token").description(TOKEN_DESCRIPTION)),
            requestFields(
                    fieldWithPath("userName").description("Name of user to create "),
                    fieldWithPath("password").description("Password of user")
            ));
    mvc.perform(put("/user")
            .contentType(MediaType.APPLICATION_JSON)
            .accept(MediaType.APPLICATION_JSON)
            .characterEncoding("UTF-8")
            .content(getLoginData())
            .header("token", token)
            .content(gson.toJson(request))
    )
            .andExpect(status().isOk())
            .andDo(document);
    verify(userProfile).registerUsingDefaults(any());
}