Ejemplo n.º 1
0
  @Test
  public void buildsAnInvalidAuditableActionBecauseOfNativeMethodName() {

    AuditableAction auditableAction =
        AuditableActionBuilder.instance().nativeMethodName(null).name(name).module(module).build();

    Set<ConstraintViolation<AuditableAction>> violations = validator.validate(auditableAction);

    assertThat(violations.size(), is(1));
  }
Ejemplo n.º 2
0
  @Test
  public void correctlyBuildsANewAuditableAction() {

    AuditableAction auditableAction =
        AuditableActionBuilder.instance()
            .nativeMethodName(nativeMethodName)
            .name(name)
            .module(module)
            .build();

    assertThat(auditableAction.getNativeName(), is(nativeMethodName));
    assertThat(auditableAction.getName(), is(name));
    assertThat(auditableAction.getModule(), is(module));
  }
Ejemplo n.º 3
0
  @Test
  public void buildsAValidAuditableAction() {

    AuditableAction auditableAction =
        AuditableActionBuilder.instance()
            .nativeMethodName(nativeMethodName)
            .name(name)
            .module(module)
            .build();

    Set<ConstraintViolation<AuditableAction>> violations = validator.validate(auditableAction);

    assertThat(violations, is(empty()));
  }