Esempio n. 1
0
  private static List<Audit> getAudits() {
    List<Audit> audits = new ArrayList<>();
    int i = 0;

    Audit randomAudit;
    randomAudit = ModelGenerator.randomAudit();
    randomAudit.setId(i++);
    randomAudit.setUsername("earlier");
    randomAudit.setDate(earlier);
    randomAudit.setAccessType(AccessType.CREATE);
    randomAudit.setAction("create");
    randomAudit.setElementAccessed(randomAudit.getAccessType().name());
    audits.add(randomAudit);

    randomAudit = ModelGenerator.randomAudit();
    randomAudit.setId(i++);
    randomAudit.setDate(current);
    randomAudit.setUsername("current");
    randomAudit.setAccessType(AccessType.READ);
    randomAudit.setAction("read");
    randomAudit.setElementAccessed(randomAudit.getAccessType().name());
    audits.add(randomAudit);

    randomAudit = ModelGenerator.randomAudit();
    randomAudit.setId(i++);
    randomAudit.setDate(later);
    randomAudit.setUsername("later");
    randomAudit.setAccessType(AccessType.UPDATE);
    randomAudit.setAction("update");
    randomAudit.setElementAccessed(randomAudit.getAccessType().name());
    audits.add(randomAudit);

    randomAudit = ModelGenerator.randomAudit();
    randomAudit.setId(i++);
    randomAudit.setDate(current);
    randomAudit.setUsername("current");
    randomAudit.setAccessType(AccessType.DELETE);
    randomAudit.setAction("delete");
    randomAudit.setElementAccessed(randomAudit.getAccessType().name());
    audits.add(randomAudit);

    randomAudit = ModelGenerator.randomAudit();
    randomAudit.setId(i++);
    randomAudit.setDate(current);
    randomAudit.setUsername("current");
    randomAudit.setAccessType(AccessType.CREATE);
    randomAudit.setAction("create");
    randomAudit.setElementAccessed(randomAudit.getAccessType().name());
    audits.add(randomAudit);

    return audits;
  }