@Test public void testAbstractEvent() throws Exception { UserInfo user = Mockito.mock(UserInfo.class); AbstractEvent systemEvent = new AbstractEvent(null) { @Override public String getDefaultDescription() { return "Desc"; } }; testValidSystemEvent(systemEvent); systemEvent = new AbstractEvent(user) { @Override public String getDefaultDescription() { return "Desc"; } }; Assert.assertEquals(user, systemEvent.getUser()); Assert.assertEquals(EventLogEventType.UNKNOWN, systemEvent.getType()); }
public AbstractEvent(UserInfo user) { this.time = Calendar.getInstance(); this.user = user == null ? EventLog.SYSTEM_USER : user; }
AbstractEvent implements EventLogEvent { public AbstractEvent(UserInfo user) { this.time = Calendar.getInstance(); this.user = user == null ? EventLog.SYSTEM_USER : user; } }
AbstractEvent implements EventLogEvent { public AbstractEvent(UserInfo user) { this.time = Calendar.getInstance(); this.user = user == null ? EventLog.SYSTEM_USER : user; } AbstractEvent(UserInfo user); }
AbstractEvent implements EventLogEvent { public AbstractEvent(UserInfo user) { this.time = Calendar.getInstance(); this.user = user == null ? EventLog.SYSTEM_USER : user; } AbstractEvent(UserInfo user); @Override Calendar getTime(); @Override UserInfo getUser(); @Override EventLogEventType getType(); }
AbstractEvent implements EventLogEvent { public AbstractEvent(UserInfo user) { this.time = Calendar.getInstance(); this.user = user == null ? EventLog.SYSTEM_USER : user; } AbstractEvent(UserInfo user); @Override Calendar getTime(); @Override UserInfo getUser(); @Override EventLogEventType getType();  }