1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-11 03:09:41 +02:00

Replace new Date().getTime() with System.getCurrentTimeMillis()

This commit is contained in:
Paul Schaub 2023-06-02 00:01:34 +02:00
parent 528591f906
commit d25e7419c9
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 27 additions and 1 deletions

View file

@ -0,0 +1,26 @@
// SPDX-FileCopyrightText: 2018 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package investigations;
import org.junit.jupiter.api.Test;
import java.util.Date;
import static org.junit.JUtils.assertEquals;
/**
* Exploratory test for date and time related operations.
*/
public class TimeTest {
@Test
public void newDateGetTimeEqualsSystemCurrentTimeMillis() {
Date date = new Date();
long dateTime = date.getTime();
long currentTime = System.currentTimeMillis();
assertEquals(dateTime, currentTime, 10);
}
}