diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2022-10-10 01:12:39 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-10 08:12:39 +0200 |
commit | 78653325d93f64d3c70aa22054b6912297edb457 (patch) | |
tree | 8c6e1901105ac2eba378a6117c53f47d23246008 /it/src | |
parent | 631b2a61850bce96b3c6eddf267958be4b26dcc6 (diff) | |
download | sonar-scanner-cli-78653325d93f64d3c70aa22054b6912297edb457.tar.gz sonar-scanner-cli-78653325d93f64d3c70aa22054b6912297edb457.zip |
[NO JIRA] Fix Its (#135)
Diffstat (limited to 'it/src')
-rw-r--r-- | it/src/test/java/com/sonarsource/scanner/it/ScannerTestCase.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/it/src/test/java/com/sonarsource/scanner/it/ScannerTestCase.java b/it/src/test/java/com/sonarsource/scanner/it/ScannerTestCase.java index 5804639..be96a06 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/ScannerTestCase.java +++ b/it/src/test/java/com/sonarsource/scanner/it/ScannerTestCase.java @@ -26,10 +26,10 @@ import com.sonar.orchestrator.version.Version; import java.io.File; import java.io.FileInputStream; import java.io.IOException; -import java.time.Instant; +import java.time.LocalDateTime; import java.time.ZoneId; +import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoUnit; import java.util.List; import java.util.Map; import java.util.Properties; @@ -56,6 +56,8 @@ import static java.util.Arrays.asList; import static java.util.Collections.singletonList; public abstract class ScannerTestCase { + private static final String DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ"; + private static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter.ofPattern(DATETIME_FORMAT); private static final Logger LOG = LoggerFactory .getLogger(ScannerTestCase.class); @@ -94,10 +96,7 @@ public abstract class ScannerTestCase { @After public void resetData() { - // The expected format is yyyy-MM-dd. - String currentDateTime = DateTimeFormatter.ISO_LOCAL_DATE - .withZone(ZoneId.of("UTC")) - .format(Instant.now()); + String currentDateTime = ZonedDateTime.now().format(DATETIME_FORMATTER); orchestrator.getServer() .newHttpCall("/api/projects/bulk_delete") |