@@ -0,0 +1,2757 @@
+/*%0A * Copyright 2017 ZJNU ACM.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage cn.edu.zjnu.acm.judge.controller.api;%0A%0Aimport cn.edu.zjnu.acm.judge.Application;%0Aimport cn.edu.zjnu.acm.judge.domain.User;%0Aimport cn.edu.zjnu.acm.judge.service.MockDataService;%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0Aimport lombok.extern.slf4j.Slf4j;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.platform.runner.JUnitPlatform;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;%0Aimport org.springframework.boot.test.context.SpringBootTest;%0Aimport org.springframework.http.MediaType;%0Aimport org.springframework.test.context.web.WebAppConfiguration;%0Aimport org.springframework.test.web.servlet.MockMvc;%0Aimport org.springframework.test.web.servlet.MvcResult;%0Aimport org.springframework.transaction.annotation.Transactional;%0A%0Aimport static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user;%0Aimport static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;%0A%0A@AutoConfigureMockMvc%0A@RunWith(JUnitPlatform.class)%0A@Slf4j%0A@SpringBootTest(classes = Application.class)%0A@Transactional%0A@WebAppConfiguration%0Apublic class UserprofileControllerTest %7B%0A%0A    @Autowired%0A    private MockMvc mvc;%0A    @Autowired%0A    private ObjectMapper objectMapper;%0A    @Autowired%0A    private MockDataService mockDataService;%0A%0A    /**%0A     * Test of update method, of class UserprofileController.%0A     *%0A     * %7B@link UserprofileController#update(User)%7D%0A     */%0A    @Test%0A    public void testUpdate() throws Exception %7B%0A        log.info(%22update%22);%0A        User request = new User();%0A        User user = mockDataService.user();%0A        MvcResult result = mvc.perform(%0A                patch(%22/api/users%22).with(user(user.getId()))%0A                        .accept(MediaType.APPLICATION_JSON)%0A                .content(objectMapper.writeValueAsString(request)).contentType(MediaType.APPLICATION_JSON))%0A                .andExpect(status().isNoContent())%0A                .andReturn();%0A    %7D%0A%0A%7D%0A

Create UserprofileControllerTest.java