GhostTest.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package com.gyee.ghost;/*
  2. @author 谢生杰
  3. @date 2022/8/3-17:10
  4. */
  5. import com.gyee.common.util.DateUtils;
  6. import com.gyee.ghost.service.RealtimeService;
  7. import com.gyee.ghost.service.auto.GhostService;
  8. import org.junit.Test;
  9. import org.junit.runner.RunWith;
  10. import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  11. import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
  12. import org.springframework.boot.test.context.SpringBootTest;
  13. import org.springframework.test.context.junit4.SpringRunner;
  14. import javax.annotation.Resource;
  15. @SpringBootTest
  16. @RunWith(SpringRunner.class)
  17. @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
  18. public class GhostTest {
  19. @Resource
  20. private GhostService ghostService;
  21. @Resource
  22. private RealtimeService realtimeService;
  23. @Test
  24. public void test1(){
  25. String yesterday = DateUtils.getYesterdayStr("yyyy-MM-dd");
  26. try {
  27. realtimeService.saveWindturbineStatus2();
  28. // realtimeService.saveWindstationStatus(yesterday,yesterday);
  29. } catch (Exception e) {
  30. e.printStackTrace();
  31. }
  32. }
  33. }