mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#658 - REFACTOR: Simplify LocalDateTime -> Timestamp conversion, use Timestamp.valueOf()
This commit is contained in:
@@ -16,16 +16,25 @@ public class ScalarTypeLocalDateTimeTest {
|
||||
LocalDateTime warmUp = LocalDateTime.now();
|
||||
|
||||
@Test
|
||||
public void testConvertToMillis() throws Exception {
|
||||
public void testNowToMillis() throws Exception {
|
||||
|
||||
warmUp.hashCode();
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
long toMillis = type.convertToMillis(LocalDateTime.now());
|
||||
|
||||
assertTrue(toMillis - now < 30);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConvertToMillis() throws Exception {
|
||||
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
long asMillis = type.convertToMillis(now);
|
||||
LocalDateTime fromMillis = type.convertFromMillis(asMillis);
|
||||
|
||||
assertEquals(now, fromMillis);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConvertFromTimestamp() throws Exception {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user