@Test public void test_integration() { RangerPolicy aPolicy = mock(RangerPolicy.class); Map<String, RangerPolicyResource> resources = _utils.createPolicyResourceMap(first); when(aPolicy.getResources()).thenReturn(resources); RangerPolicyResourceSignature signature = new RangerPolicyResourceSignature(aPolicy); RangerPolicy anotherPolicy = mock(RangerPolicy.class); resources = _utils.createPolicyResourceMap(data_second); when(anotherPolicy.getResources()).thenReturn(resources); RangerPolicyResourceSignature anotherSignature = new RangerPolicyResourceSignature(anotherPolicy); Assert.assertTrue(signature.equals(anotherSignature)); Assert.assertTrue(anotherSignature.equals(signature)); }
@Override public boolean equals(Object object) { if (object == null || !(object instanceof RangerPolicyResourceSignature)) { return false; } RangerPolicyResourceSignature that = (RangerPolicyResourceSignature)object; return Objects.equals(this._hash, that._hash); }
RangerPolicyResourceSignature { @Override public boolean equals(Object object) { if (object == null || !(object instanceof RangerPolicyResourceSignature)) { return false; } RangerPolicyResourceSignature that = (RangerPolicyResourceSignature)object; return Objects.equals(this._hash, that._hash); } }
RangerPolicyResourceSignature { @Override public boolean equals(Object object) { if (object == null || !(object instanceof RangerPolicyResourceSignature)) { return false; } RangerPolicyResourceSignature that = (RangerPolicyResourceSignature)object; return Objects.equals(this._hash, that._hash); } RangerPolicyResourceSignature(RangerPolicy policy);   RangerPolicyResourceSignature(String string); }
RangerPolicyResourceSignature { @Override public boolean equals(Object object) { if (object == null || !(object instanceof RangerPolicyResourceSignature)) { return false; } RangerPolicyResourceSignature that = (RangerPolicyResourceSignature)object; return Objects.equals(this._hash, that._hash); } RangerPolicyResourceSignature(RangerPolicy policy);   RangerPolicyResourceSignature(String string); String getSignature(); @Override int hashCode(); @Override boolean equals(Object object); @Override String toString(); }
RangerPolicyResourceSignature { @Override public boolean equals(Object object) { if (object == null || !(object instanceof RangerPolicyResourceSignature)) { return false; } RangerPolicyResourceSignature that = (RangerPolicyResourceSignature)object; return Objects.equals(this._hash, that._hash); } RangerPolicyResourceSignature(RangerPolicy policy);   RangerPolicyResourceSignature(String string); String getSignature(); @Override int hashCode(); @Override boolean equals(Object object); @Override String toString();  }