Ensure that verbs occur only once in the collection

This is necessary for equals to work correctly
This commit is contained in:
René Pfeuffer
2019-02-04 16:33:03 +01:00
parent 42456af6d5
commit 7369f1cfce
2 changed files with 14 additions and 4 deletions

View File

@@ -46,4 +46,13 @@ class RepositoryPermissionTest {
assertThat(permission1).isNotEqualTo(permission2);
}
@Test
void shouldBeEqualWithRedundantVerbs() {
RepositoryPermission permission1 = new RepositoryPermission("name1", asList("one", "two"), false);
RepositoryPermission permission2 = new RepositoryPermission("name1", asList("one", "two"), false);
permission2.setVerbs(asList("one", "two", "two"));
assertThat(permission1).isEqualTo(permission2);
}
}