From 0bcc057e741af3fbc108f42b75f9d42f48f6a51e Mon Sep 17 00:00:00 2001 From: Yuuta Liang Date: Sat, 14 Oct 2023 05:12:06 +0800 Subject: Implement the CA Signed-off-by: Yuuta Liang --- src/test/model/ca/AuditLogEntryTest.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/test/model/ca/AuditLogEntryTest.java (limited to 'src/test/model/ca/AuditLogEntryTest.java') 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()); + } +} -- cgit v1.2.3