From ef0f6655e1e01bdf12a0af6ac0e3280a519a051f Mon Sep 17 00:00:00 2001 From: Zach Wright Date: Thu, 9 Aug 2018 13:34:51 -0400 Subject: [PATCH] KPMP-226: UTC in metadata file --- src/main/java/org/kpmp/dao/UploadPackageMetadata.java | 2 +- src/test/java/org/kpmp/dao/UploadPackageMetadataTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/kpmp/dao/UploadPackageMetadata.java b/src/main/java/org/kpmp/dao/UploadPackageMetadata.java index 1f532921..afc564f7 100755 --- a/src/main/java/org/kpmp/dao/UploadPackageMetadata.java +++ b/src/main/java/org/kpmp/dao/UploadPackageMetadata.java @@ -64,7 +64,7 @@ public UploadPackageMetadata(UploadPackage uploadPackage) { if (uploadPackage.getExperimentDate() != null) { this.experimentDate = dt.format(uploadPackage.getExperimentDate()); } - this.createdAt = dt.format(uploadPackage.getCreatedAt()); + this.createdAt = dt.format(uploadPackage.getCreatedAt()) + " UTC"; if (uploadPackage.getPackageTypeOther() != null) { this.packageType = uploadPackage.getPackageTypeOther().getPackageType(); } else { diff --git a/src/test/java/org/kpmp/dao/UploadPackageMetadataTest.java b/src/test/java/org/kpmp/dao/UploadPackageMetadataTest.java index e748c207..aa3dff6d 100755 --- a/src/test/java/org/kpmp/dao/UploadPackageMetadataTest.java +++ b/src/test/java/org/kpmp/dao/UploadPackageMetadataTest.java @@ -77,7 +77,7 @@ public void tearDown() throws Exception { @Test public void testConstructor() throws Exception { - assertEquals(dateFormat.format(now), uploadPackageMetadata.getCreatedAt()); + assertEquals(dateFormat.format(now) + " UTC", uploadPackageMetadata.getCreatedAt()); assertEquals(dateFormat.format(now), uploadPackageMetadata.getExperimentDate()); assertEquals("Mars University", uploadPackageMetadata.getInstitution()); assertEquals("uuid-package", uploadPackageMetadata.getId()); @@ -103,7 +103,7 @@ public void testGenerateJSON() throws JsonProcessingException { String date = dateFormat.format(now); String expected = "{\"id\":\"uuid-package\",\"subjectId\":\"42\",\"experimentDate\":\"" + date + "\",\"createdAt\":\"" + date - + "\",\"packageType\":\"Big Data\",\"protocol\":\"The Protocol\",\"submitterFirstName\":\"Mattie\",\"submitterLastName\":\"Dayta\"," + + " UTC\",\"packageType\":\"Big Data\",\"protocol\":\"The Protocol\",\"submitterFirstName\":\"Mattie\",\"submitterLastName\":\"Dayta\"," + "\"institution\":\"Mars University\",\"files\":[{\"path\":\"/package1/filename\",\"size\":12345,\"fileName\":\"filename\",\"description\":\"file description\",\"universalId\":\"uuid-file\"}]}"; assertEquals(expected, actual); }