diff --git a/base-buildpackage/src/test/java/com/hzya/frame/TestNifiLog.java b/base-buildpackage/src/test/java/com/hzya/frame/TestNifiLog.java new file mode 100644 index 00000000..eaa19d60 --- /dev/null +++ b/base-buildpackage/src/test/java/com/hzya/frame/TestNifiLog.java @@ -0,0 +1,59 @@ +package com.hzya.frame; + +import com.github.pagehelper.PageInfo; +import com.hzya.frame.nifilog.dao.ILoggingEvent20250430Dao; +import com.hzya.frame.nifilog.entity.LoggingEvent20250430Entity; +import com.hzya.frame.page.PageAttribute; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author:liuyang + * @Package:com.hzya.frame + * @Project:fw-nifi + * @name:TestNifiLog + * @Date:2025/5/20 11:53 + * @Filename:TestNifiLog + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {WebappApplication.class}) +public class TestNifiLog { + + @Autowired + private ILoggingEvent20250430Dao iLoggingEvent20250430Dao; + + /** + * 获取nifi token + */ + @Test + public void getAccessToken() { + try { +// PageAttribute loggingEvent20250430EntityPageAttribute = iLoggingEvent20250430Dao.queryPaged(); + + List arg0List = new ArrayList<>(); + arg0List.add("UpdateAttribute[id=ad841aed-30f7-16e2-4fa0-595ab0ab9fdc]"); + + List logDateList = new ArrayList<>(); + logDateList.add("20250519"); + logDateList.add("20250520"); + + LoggingEvent20250430Entity loggingEvent20250430Entity = new LoggingEvent20250430Entity(); + loggingEvent20250430Entity.setArg0List(arg0List); + loggingEvent20250430Entity.setLogDateList(logDateList); + loggingEvent20250430Entity.setPageNum(1); + loggingEvent20250430Entity.setPageSize(100); + + PageInfo loggingEvent20250430EntityPageInfo = iLoggingEvent20250430Dao.queryLoggingEventByProcessorId(loggingEvent20250430Entity); + List list = loggingEvent20250430EntityPageInfo.getList(); + System.out.println(list.size()); + } catch (Exception e) { + e.printStackTrace(); + } + } +}