package com.jiayue.ipfcst.console.service;

import com.alibaba.fastjson.JSON;
import com.jiayue.ipfcst.BaseTest;
import com.jiayue.ipfcst.common.data.entity.WindTowerStatusData;
import com.jiayue.ipfcst.dataexchange.service.EnvironmentDataGenerator;
import com.jiayue.ipfcst.dataexchange.service.equipmentstatusdata.WindTowerStatusDataService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import static org.junit.jupiter.api.Assertions.*;

/**
 * 删除上报日志测试类
 *
 * @author xsl
 * @version 3.0
 */
public class DeleteUploadLogServiceTest extends BaseTest {

  @Autowired
  DeleteUploadLogService deleteUploadLogService;

  @Autowired
  EnvironmentDataGenerator environmentDataGenerator;

  @Autowired
  WindTowerStatusDataService windTowerStatusDataService;

  @Test
  public void executeDelete() throws Exception{
    deleteUploadLogService.executeDelete();
  }


  @Test
  public  void ddd() throws InterruptedException {
    for(;;) {
      WindTowerStatusData w = environmentDataGenerator.getWindTowerDataGenerator(1).generateWindTowerData();
      System.out.println(JSON.toJSONString(w));
      windTowerStatusDataService.save(w);
      Thread.sleep(60*1000);
    }
  }
}
