import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nantian.cloud.jly.controller.TestFileController;
import com.nantian.cloud.jly.entity.CheckGaugesTypeReportAmend;
import com.nantian.cloud.jly.entity.CheckPlan;
import com.nantian.cloud.jly.service.CheckGaugesTypeReportAmendService;
import com.nantian.cloud.jly.service.CheckPlanService;
import com.nantian.cloud.jly.service.impl.CheckGaugesTypeReportAmendServiceImpl;
import com.nantian.cloud.jly.service.impl.CheckPlanServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.RequestBuilder;

import javax.annotation.Resource;
import javax.ws.rs.core.MediaType;
import java.util.List;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;


//@RunWith(SpringRunner.class)
@AutoConfigureMockMvc
@SpringBootTest
public class SplitTest{
//    public static void main(String[] args) {
//        String str="123,1";
//        String[] b=str.split(",");
//        System.out.println(b[1]);
//    }
    @Autowired
    private MockMvc mockMvc;


//    @Resource
//    private CheckGaugesTypeReportAmendService checkGaugesTypeReportAmendService;
//
//    public SplitTest() {
//    }

//    @Test
//    public void add(){
//
////        System.out.println("hahaahahahahahhaahhahahha");\
//        CheckGaugesTypeReportAmendService service = new CheckGaugesTypeReportAmendServiceImpl();
////        QueryWrapper<CheckGaugesTypeReportAmend> wrapper = new QueryWrapper<>();
////        QueryWrapper<CheckGaugesTypeReportAmend> epc = wrapper.eq("epc", "915325007571806991");
////        CheckGaugesTypeReportAmend one = service.getOne(epc);
////        System.out.println(one);
//        List<CheckGaugesTypeReportAmend> list = service.list();
//        System.out.println(list);
//
//    }

    @Test
    public void test(){
        try {
            String uuidStr= "1#精脱甲烷真空泵.pdf<86fec06b-067f-420a-93b0-0231299e6083";
            System.out.println(mockMvc);
            mockMvc.perform(get("/testFile/download2"))
                    .andExpect(status().isOk())
                    .andExpect(content().string(uuidStr));
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}
