aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/juick/tests')
-rw-r--r--src/test/java/com/juick/tests/MessageTests.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/java/com/juick/tests/MessageTests.java b/src/test/java/com/juick/tests/MessageTests.java
index 45575ded..a0cfd444 100644
--- a/src/test/java/com/juick/tests/MessageTests.java
+++ b/src/test/java/com/juick/tests/MessageTests.java
@@ -3,6 +3,7 @@ package com.juick.tests;
import static org.junit.Assert.assertEquals;
import com.juick.json.MessageSerializer;
+import com.juick.util.DateFormattersHolder;
import com.juick.xmpp.extensions.JuickMessage;
import org.json.JSONObject;
import org.junit.Test;
@@ -33,7 +34,7 @@ public class MessageTests {
msg.setDate(currentDate);
MessageSerializer serializer = new MessageSerializer();
JSONObject jsonMessage = serializer.serialize(msg);
- assertEquals("date should be in timestamp field", serializer.getDf().format(currentDate),
+ assertEquals("date should be in timestamp field", DateFormattersHolder.getMessageFormatterInstance().format(currentDate),
jsonMessage.getString("timestamp"));
JuickMessage xmppMessage = new JuickMessage(msg);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
@@ -42,7 +43,7 @@ public class MessageTests {
Document doc = db.parse(new ByteArrayInputStream(xmppMessage.toString().getBytes("UTF-8")));
Node juickNode = doc.getElementsByTagName("juick").item(0);
NamedNodeMap attrs = juickNode.getAttributes();
- assertEquals("date should be in ts field", serializer.getDf().format(currentDate),
+ assertEquals("date should be in ts field", DateFormattersHolder.getMessageFormatterInstance().format(currentDate),
attrs.getNamedItem("ts").getNodeValue());
}
} \ No newline at end of file