From dd3c700f44b37e55976063dc38ad66789305d285 Mon Sep 17 00:00:00 2001 From: dernasherbrezon Date: Mon, 18 Nov 2024 11:35:36 +0000 Subject: [PATCH] fix unit test --- src/test/java/ru/r2cloud/it/SatelliteLoadTest.java | 7 ------- src/test/java/ru/r2cloud/it/util/BaseTest.java | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/test/java/ru/r2cloud/it/SatelliteLoadTest.java b/src/test/java/ru/r2cloud/it/SatelliteLoadTest.java index 11fa07d7..587b03aa 100644 --- a/src/test/java/ru/r2cloud/it/SatelliteLoadTest.java +++ b/src/test/java/ru/r2cloud/it/SatelliteLoadTest.java @@ -1,10 +1,5 @@ package ru.r2cloud.it; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.attribute.FileTime; -import java.util.concurrent.TimeUnit; - import org.junit.Test; import ru.r2cloud.TestUtil; @@ -14,8 +9,6 @@ public class SatelliteLoadTest extends RegisteredTest { @Test public void testLoad() throws Exception { - Path p = config.getPathFromProperty("satellites.meta.location"); - Files.setLastModifiedTime(p, FileTime.from(1719525695573L, TimeUnit.MILLISECONDS)); TestUtil.assertJson("expected/satellite.json", client.getSatellite("25338")); } diff --git a/src/test/java/ru/r2cloud/it/util/BaseTest.java b/src/test/java/ru/r2cloud/it/util/BaseTest.java index fbe56265..1e601cec 100644 --- a/src/test/java/ru/r2cloud/it/util/BaseTest.java +++ b/src/test/java/ru/r2cloud/it/util/BaseTest.java @@ -14,9 +14,13 @@ import java.net.InetSocketAddress; import java.net.http.HttpResponse; import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.FileTime; import java.util.Properties; import java.util.Random; import java.util.UUID; +import java.util.concurrent.TimeUnit; import java.util.logging.LogManager; import org.junit.After; @@ -172,6 +176,8 @@ protected Configuration prepareConfiguration() throws IOException { w.append("ittests"); } config.setProperty("server.keyword.location", setupKeyword.getAbsolutePath()); + Path p = config.getPathFromProperty("satellites.meta.location"); + Files.setLastModifiedTime(p, FileTime.from(1719525695573L, TimeUnit.MILLISECONDS)); return config; }