aboutsummaryrefslogtreecommitdiff
path: root/src/test/model/ca/AuditLogEntryTest.java
diff options
context:
space:
mode:
authorYuuta Liang <yuutaw@students.cs.ubc.ca>2023-10-14 05:12:06 +0800
committerYuuta Liang <yuutaw@students.cs.ubc.ca>2023-10-14 05:12:06 +0800
commit0bcc057e741af3fbc108f42b75f9d42f48f6a51e (patch)
treed638c81c0778554a8902efc59000e61db74060be /src/test/model/ca/AuditLogEntryTest.java
parentf369da34cf9aca151df0150d90e651e6a88ee700 (diff)
downloadjca-0bcc057e741af3fbc108f42b75f9d42f48f6a51e.tar
jca-0bcc057e741af3fbc108f42b75f9d42f48f6a51e.tar.gz
jca-0bcc057e741af3fbc108f42b75f9d42f48f6a51e.tar.bz2
jca-0bcc057e741af3fbc108f42b75f9d42f48f6a51e.zip
Implement the CA
Signed-off-by: Yuuta Liang <yuutaw@students.cs.ubc.ca>
Diffstat (limited to 'src/test/model/ca/AuditLogEntryTest.java')
-rw-r--r--src/test/model/ca/AuditLogEntryTest.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/model/ca/AuditLogEntryTest.java b/src/test/model/ca/AuditLogEntryTest.java
new file mode 100644
index 0000000..af44947
--- /dev/null
+++ b/src/test/model/ca/AuditLogEntryTest.java
@@ -0,0 +1,26 @@
+package model.ca;
+
+import org.junit.jupiter.api.Test;
+
+import java.time.ZonedDateTime;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class AuditLogEntryTest {
+ @Test
+ void testConstructor() {
+ ZonedDateTime now = ZonedDateTime.now();
+ AuditLogEntry entry = new AuditLogEntry("user", now, "action123");
+ assertEquals("user", entry.getUser());
+ assertEquals(now, entry.getTime());
+ assertEquals("action123", entry.getAction());
+ }
+
+ @Test
+ void testToString() {
+ ZonedDateTime now = ZonedDateTime.now();
+ AuditLogEntry entry = new AuditLogEntry("user", now, "action123");
+ assertEquals(now + "\tuser\taction123",
+ entry.toString());
+ }
+}