package com.htfp.weather.download; import org.junit.jupiter.api.Test; import java.util.List; import static org.junit.jupiter.api.Assertions.*; /** * @Author : shiyi * @Date : 2024/4/25 16:15 * @Description : */ class GfsDownloaderTest { public static GfsDataConfig gfsDataConfig = new GfsDataConfig(); static { gfsDataConfig.readConfig(); } GfsDownloader gfsDownloader = new GfsDownloader(gfsDataConfig); @Test void iniTimeSetting() { gfsDownloader.iniTimeSetting(); } @Test void download() { gfsDownloader.iniTimeSetting(); List fileInfoList = gfsDownloader.getFilesInfo(); gfsDownloader.download(fileInfoList.get(0)); } @Test void downloadAll() { gfsDownloader.iniTimeSetting(); List fileInfoList = gfsDownloader.getFilesInfo(); boolean isComplete = gfsDownloader.downloadAll(fileInfoList); if (isComplete) { System.out.println("下载完成"); } } @Test void getFilesInfo() { gfsDownloader.iniTimeSetting(); List fileInfoList = gfsDownloader.getFilesInfo(); for (FileInfo fileInfo :fileInfoList) { System.out.println(fileInfo); } } }