Let assertion validity checks to be more flexible
when comparing dates.
This commit is contained in:
parent
7cb5380e75
commit
9d4cafd2c9
|
|
@ -101,26 +101,32 @@ public final class AssertionImpl implements Assertion {
|
|||
CommonUtils.assertNotNull(this.attributes, "attributes cannot be null.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getAuthenticationDate() {
|
||||
return this.authenticationDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getValidFromDate() {
|
||||
return this.validFromDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getValidUntilDate() {
|
||||
return this.validUntilDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getAttributes() {
|
||||
return this.attributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttributePrincipal getPrincipal() {
|
||||
return this.principal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
if (this.validFromDate == null) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,11 @@ public final class AssertionImplTests extends TestCase {
|
|||
assertNull(assertion.getPrincipal().getProxyTicketFor("test"));
|
||||
}
|
||||
|
||||
public void testAssertionValidity() throws Exception {
|
||||
final Assertion assertion = new AssertionImpl(CONST_PRINCIPAL, CONST_ATTRIBUTES);
|
||||
assertTrue(assertion.isValid());
|
||||
}
|
||||
|
||||
public void testCompleteConstructor() {
|
||||
final Assertion assertion = new AssertionImpl(CONST_PRINCIPAL, CONST_ATTRIBUTES);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue