diff options
author | Sandeep J <sandeejh@in.ibm.com> | 2018-07-20 17:05:39 +0530 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-07-23 12:55:03 +0000 |
commit | bbb9002a161b2513e8c543f824de796f1fdfa465 (patch) | |
tree | 131dedde3f54b605d5b6748d96a7dfde54ed562b /appc-common/src/test/java/org | |
parent | c66a616860708058ce8dc532c66410336a57a4c4 (diff) |
added few more test cases to TimeTest.java
added few more test cases to TimeTest.java to increase code coverage
Issue-ID: APPC-1086
Change-Id: I910a5ab4420cc38d9c27fc2a206ac96b5377e225
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-common/src/test/java/org')
-rw-r--r-- | appc-common/src/test/java/org/onap/appc/util/TimeTest.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/appc-common/src/test/java/org/onap/appc/util/TimeTest.java b/appc-common/src/test/java/org/onap/appc/util/TimeTest.java index 8bf04a0c6..aef02a293 100644 --- a/appc-common/src/test/java/org/onap/appc/util/TimeTest.java +++ b/appc-common/src/test/java/org/onap/appc/util/TimeTest.java @@ -97,4 +97,32 @@ public class TimeTest { String expected="19 juil. 2018 00:00:00"; assertEquals(expected,Time.getDateByLocaleAndTimeZone(dateNow,locale,timeZone)); } + + @Test + public void testUtcFormat() { + final Date date = new Date("19-Jul-2018"); + String expected="07/19/2018 00:00:00"; + assertEquals(expected,Time.utcFormat(date)); + } + + @Test + public void testLocalTime() { + long expected=1532083631; + assertEquals(expected,Time.localTime(1532083631)); + } + + @Test + public void testSetDate() { + Calendar cal = Calendar.getInstance(); + cal.set(Calendar.YEAR, 2018); + cal.set(Calendar.MONTH, 07); + cal.set(Calendar.DAY_OF_MONTH, 03); + Calendar cal1= Time.setDate(cal, 2018, 07, 03); + assertEquals(cal, cal1); + } + + @Test + public void testStartOfDayLocal() { + assertTrue(Time.startOfDayLocal() instanceof Date); + } } |