From 1dab1f9adf51c07e2e9f38dad6627ee4a63068e1 Mon Sep 17 00:00:00 2001 From: Fuzzlemann Date: Tue, 15 Aug 2017 15:02:06 +0200 Subject: [PATCH] Re-enable tests for FormatTimeStamp --- .../plan/utilities/FormatUtilsTest.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Plan/src/test/java/main/java/com/djrapitops/plan/utilities/FormatUtilsTest.java b/Plan/src/test/java/main/java/com/djrapitops/plan/utilities/FormatUtilsTest.java index ea4c64314..713e372f4 100644 --- a/Plan/src/test/java/main/java/com/djrapitops/plan/utilities/FormatUtilsTest.java +++ b/Plan/src/test/java/main/java/com/djrapitops/plan/utilities/FormatUtilsTest.java @@ -5,7 +5,6 @@ import org.bukkit.Location; import org.bukkit.World; import org.bukkit.plugin.java.JavaPlugin; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.core.classloader.annotations.PrepareForTest; @@ -13,6 +12,7 @@ import org.powermock.modules.junit4.PowerMockRunner; import test.java.utils.MockUtils; import test.java.utils.TestInit; +import java.text.SimpleDateFormat; import java.util.Date; import static org.junit.Assert.*; @@ -63,26 +63,30 @@ public class FormatUtilsTest { assertEquals(expResult, result); } - /** - * - */ @Test - @Ignore public void testFormatTimeStamp() { + SimpleDateFormat dateFormat = new SimpleDateFormat("MMM dd',' HH':'mm"); + + Date date = new Date(); + date.setTime(0); + + String expResult = dateFormat.format(date); + long epochZero = 0L; - String expResult = "Jan 01, 01:00"; String result = FormatUtils.formatTimeStamp(epochZero); assertEquals(expResult, result); } - /** - * - */ @Test - @Ignore public void testFormatTimeStampYear() { + SimpleDateFormat dateFormat = new SimpleDateFormat("MMM dd YYYY',' HH':'mm"); + + Date date = new Date(); + date.setTime(0); + + String expResult = dateFormat.format(date); + long epochZero = 0L; - String expResult = "Jan 01 1970, 01:00"; String result = FormatUtils.formatTimeStampYear(epochZero); assertEquals(expResult, result); }