//package com.tykj.dev.train;
//
//import com.github.wenhao.jpa.Specifications;
//import com.tykj.dev.device.task.repository.TaskDao;
//import com.tykj.dev.device.task.subject.domin.Task;
//import com.tykj.dev.device.train.entity.vo.WorkHandoverAddVo;
//import com.tykj.dev.device.train.entity.vo.WorkHandoverVo;
//import com.tykj.dev.device.train.service.WorkHandoverService;
//import com.tykj.dev.device.user.subject.service.UserService;
//import com.tykj.dev.misc.base.StatusEnum;
//import com.tykj.dev.union.BaseTest;
//import lombok.extern.slf4j.Slf4j;
//import org.junit.jupiter.api.Test;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.MediaType;
//import org.springframework.security.test.context.support.WithMockUser;
//import org.springframework.test.context.ActiveProfiles;
//import org.springframework.test.web.servlet.MockMvc;
//import org.springframework.test.web.servlet.RequestBuilder;
//
//import static com.tykj.dev.misc.utils.JacksonUtil.toJSon;
//import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
//import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
//
///**
// * DeviceCheckControllerTest.
// *
// * @author Matrix <xhyrzldf@gmail.com>
// * @since 2020/9/15 at 11:17 上午
// */
//@SuppressWarnings("ALL")
//@WithMockUser(username = "shena", password = "qwer1234", authorities = "省A专管员")
//@ActiveProfiles("dev")
//@Slf4j
//class WorkHandoverTest extends BaseTest {
//
//    @Autowired
//    protected MockMvc mockMvc;
//    @Autowired
//    WorkHandoverService workHandoverService;
//    @Autowired
//    UserService userService;
//    @Autowired
//    private TaskDao taskRepo;
//
//    private String url = "/user/handover/";
//
//    @Test
//    void startManualCheck() throws Exception {
//
//        WorkHandoverAddVo workHandoverAddVo = new WorkHandoverAddVo();
//        //交接人
////        workHandoverAddVo.setHandoverUserId(9);
////        //移交人
////        workHandoverAddVo.setTurnOverUserId(10);
////        //监交人
////        workHandoverAddVo.setInUserName("省a专管员");
//
//        // 测试
//        RequestBuilder request;
//
//        request = post(url + "create")
//                .header("Origin", "*")
//                .contentType(MediaType.APPLICATION_JSON)
//                .content(toJSon(workHandoverAddVo));
//
//        mockMvc.perform(request)
//                .andExpect(status().isOk())
//                .andDo(mvcResult1 -> System.out.println("[测试结果] 工作交接任务测试通过"));
//
//
//        // A 接口
//        Task initTask = taskRepo.findAll(Specifications.<Task>and()
//                .eq("billStatus", StatusEnum.WORKHANDOVER1011.id)
//                .build())
//                .get(0);
//        Integer workBillId = initTask.getBillId();
//        WorkHandoverVo workHandover = workHandoverService.findById(workBillId);
//        if (workHandover != null) {
//            log.info("[workHandover]  新建工作交接业务完成");
//        } else {
//            log.info("[workHandover]  新建工作交接业务不通过");
//        }
//
//    }
//}