diff options
author | mpriyank <priyank.maheshwari@est.tech> | 2024-05-03 13:45:03 +0100 |
---|---|---|
committer | mpriyank <priyank.maheshwari@est.tech> | 2024-05-03 15:35:11 +0100 |
commit | e834c9345da1819613044c423d6cd3a096aad55e (patch) | |
tree | 4edbe1aa223fd49ef0f875b1bf5cbe9a4deefa8d /cps-rest/src/test/java | |
parent | c5f6c45eb5cd94f76f1f39e5a4593996a9f25474 (diff) |
[BUG] Correctly parse observedTimestamp
- Using the DateTimeUtility to parse the passed OffsetDateTime and using
it for conversion to string
- Moving to actual src/main/java from test side as it is to be used in
the prod code as well and only keeping the methods in use.
- Added test to fix the coverage issue
Issue-ID: CPS-2211
Change-Id: I2b4325bb77a6da7fd470986b1da293f455650375
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-rest/src/test/java')
-rw-r--r-- | cps-rest/src/test/java/org/onap/cps/utils/DateTimeUtility.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cps-rest/src/test/java/org/onap/cps/utils/DateTimeUtility.java b/cps-rest/src/test/java/org/onap/cps/utils/DateTimeUtility.java index f8d709647c..af0efe2e21 100644 --- a/cps-rest/src/test/java/org/onap/cps/utils/DateTimeUtility.java +++ b/cps-rest/src/test/java/org/onap/cps/utils/DateTimeUtility.java @@ -30,11 +30,11 @@ public interface DateTimeUtility { DateTimeFormatter ISO_TIMESTAMP_FORMATTER = DateTimeFormatter.ofPattern(ISO_TIMESTAMP_PATTERN); static OffsetDateTime toOffsetDateTime(String datetTimestampAsString) { - return ! StringUtils.hasLength(datetTimestampAsString) - ? null : OffsetDateTime.parse(datetTimestampAsString, ISO_TIMESTAMP_FORMATTER); + return !StringUtils.hasLength(datetTimestampAsString) ? null + : OffsetDateTime.parse(datetTimestampAsString, ISO_TIMESTAMP_FORMATTER); } static String toString(OffsetDateTime offsetDateTime) { return offsetDateTime != null ? ISO_TIMESTAMP_FORMATTER.format(offsetDateTime) : null; } -} +}
\ No newline at end of file |