|
|
|
|
@ -32,7 +32,6 @@ import static org.assertj.core.api.Assertions.assertThat;
@@ -32,7 +32,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
* |
|
|
|
|
* @author Dave Syer |
|
|
|
|
* @author Vedran Pavic |
|
|
|
|
* @author Nakul Mishra |
|
|
|
|
*/ |
|
|
|
|
public class AuditEventTests { |
|
|
|
|
|
|
|
|
|
@ -56,6 +55,13 @@ public class AuditEventTests {
@@ -56,6 +55,13 @@ public class AuditEventTests {
|
|
|
|
|
assertThat(event.getData().get("c")).isEqualTo("d"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void nullPrincipalIsMappedToEmptyString() { |
|
|
|
|
AuditEvent auditEvent = new AuditEvent(null, "UNKNOWN", |
|
|
|
|
Collections.singletonMap("a", (Object) "b")); |
|
|
|
|
assertThat(auditEvent.getPrincipal()).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void nullTimestamp() throws Exception { |
|
|
|
|
this.thrown.expect(IllegalArgumentException.class); |
|
|
|
|
@ -64,12 +70,6 @@ public class AuditEventTests {
@@ -64,12 +70,6 @@ public class AuditEventTests {
|
|
|
|
|
Collections.singletonMap("a", (Object) "b")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void nullPrincipal() { |
|
|
|
|
AuditEvent auditEvent = new AuditEvent(null, "UNKNOWN", Collections.singletonMap("a", (Object) "b")); |
|
|
|
|
assertThat(auditEvent.getPrincipal()).isEmpty(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void nullType() throws Exception { |
|
|
|
|
this.thrown.expect(IllegalArgumentException.class); |
|
|
|
|
|