diff options
Diffstat (limited to 'src/test/model/ca/AuditLogEntryTest.java')
-rw-r--r-- | src/test/model/ca/AuditLogEntryTest.java | 26 |
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()); + } +} |