aboutsummaryrefslogtreecommitdiff
path: root/src/test/model/ca/AuditLogEntryTest.java
blob: af4494782a8e0122223e96f2ba4fb1b2bfd6071c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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());
    }
}