@Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } KerberosPrincipalId other = (KerberosPrincipalId) o; return Objects.equals(principal, other.principal); }
@Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } KerberosPrincipalId other = (KerberosPrincipalId) o; return Objects.equals(principal, other.principal); }
@Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } InstanceId other = (InstanceId) o; return Objects.equals(instance, other.instance); }
@Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } InstanceId other = (InstanceId) o; return Objects.equals(instance, other.instance); }
@Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } QueryId queryId = (QueryId) o; return Objects.equals(handle, queryId.handle); }
@Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } QueryId queryId = (QueryId) o; return Objects.equals(handle, queryId.handle); }
@Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } SystemServiceId that = (SystemServiceId) o; return Objects.equals(service, that.service); }
@Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } SystemServiceId that = (SystemServiceId) o; return Objects.equals(service, that.service); }
@Override public final boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Id)) { return false; } Id other = (Id) obj; return this.toEntityId().equals(other.toEntityId()); }
@Override public final boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Id)) { return false; } Id other = (Id) obj; return this.toEntityId().equals(other.toEntityId()); }
private void testRewrite(Method method, Object rewrittenObject, EntityId entityId, Class<? extends Exception> expectedException, Object... args) throws NoSuchMethodException { try { method.invoke(rewrittenObject, args); } catch (Exception e) { // Since the above method is invoked through reflection any exception thrown will be wrapped in // InvocationTargetException so verify that the root cause is the expected exception confirming that enforce // was called successfully. if (!(e instanceof InvocationTargetException && expectedException.isAssignableFrom(e.getCause().getClass()))) { Assert.fail(String.format("Got exception %s while expecting %s%s%s", e.getCause(), ExceptionAuthorizationEnforcer.ExpectedException.class.getName(), System.lineSeparator(), getFormattedStackTrace(e.getStackTrace()))); } if (entityId != null) { if (!ExceptionAuthorizationEnforcer.ExpectedException.class.isAssignableFrom(e.getCause().getClass())) { Assert.fail(String.format("Exception %s is not assignable from %s to match entity %s", e.getCause(), ExceptionAuthorizationEnforcer.ExpectedException.class.getName(), entityId)); } ExceptionAuthorizationEnforcer.ExpectedException exception = (ExceptionAuthorizationEnforcer.ExpectedException) e.getCause(); if (!exception.getEntityId().equals(entityId)) { Assert.fail(String.format("Expected %s with entity %s but found %s", ExceptionAuthorizationEnforcer.ExpectedException.class.getSimpleName(), entityId, exception.getEntityId())); } } } }