//package com.nokia.domainb.capability;
//
//import cn.chinaunicom.open.nlgxptconnection.COMPConnectionContext;
//import com.nokia.domainb.util.Utils;
//import de.siegmar.fastcsv.writer.CsvWriter;
//import org.junit.jupiter.api.Test;
//import org.springframework.util.StopWatch;
//
//import java.io.IOException;
//import java.io.OutputStreamWriter;
//import java.nio.file.Files;
//import java.nio.file.Paths;
//import java.time.LocalDateTime;
//import java.util.Set;
//
//public class IsBlackNameTest {
//    @Test
//    void testQuery() {
//        IsBlackName isBlackName = new IsBlackName();
//        StopWatch stopWatch = new StopWatch();
//        stopWatch.start();
//        Set<String> phones = Utils.readPhones();
//        String filePath = "result/黑名单校验.csv";
//        try (OutputStreamWriter osw = new OutputStreamWriter(Files.newOutputStream(Paths.get(filePath)), "GBK");
//             CsvWriter csv = CsvWriter.builder().build(osw);) {
//            csv.writeRow("手机号", "时间", "调用时长", "结果");
//            phones.forEach(t -> {
//                LocalDateTime startTime = LocalDateTime.now();
//                long startTimestamp = System.currentTimeMillis();
//                COMPConnectionContext result = isBlackName.query(t, false);
//                long endTimestamp = System.currentTimeMillis();
//                long cost = endTimestamp - startTimestamp;
//                csv.writeRow(t, startTime.toString(), String.valueOf(cost), result.getResponseContext());
//            });
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        stopWatch.stop();
//        System.out.println(stopWatch.prettyPrint());
//    }
//}
