diff --git a/src/test/java/fr/plil/sio/persistence/jdbc/GroupServiceTest.java b/src/test/java/fr/plil/sio/persistence/jdbc/GroupServiceTest.java index 838f767..e9f4c0f 100644 --- a/src/test/java/fr/plil/sio/persistence/jdbc/GroupServiceTest.java +++ b/src/test/java/fr/plil/sio/persistence/jdbc/GroupServiceTest.java @@ -48,12 +48,14 @@ public class GroupServiceTest extends AbstractServiceSupport { groupService.create("group"); } + @Test public void testDeleteGroup() { assertTrue(groupService.delete("group")); assertNull(groupService.findByName("group")); assertFalse(groupService.delete("group")); } + @Test public void testDeleteNotExistingGroup() { assertFalse(groupService.delete("not-a-group")); } diff --git a/src/test/java/fr/plil/sio/persistence/jdbc/UserServiceTest.java b/src/test/java/fr/plil/sio/persistence/jdbc/UserServiceTest.java index b2d0ea6..66f110c 100644 --- a/src/test/java/fr/plil/sio/persistence/jdbc/UserServiceTest.java +++ b/src/test/java/fr/plil/sio/persistence/jdbc/UserServiceTest.java @@ -63,10 +63,12 @@ public class UserServiceTest extends AbstractServiceSupport { userService.create("user", "group"); } + @Test public void testDeleteUser() { assertTrue(userService.delete("user")); } + @Test public void testDeleteUserIfNotFound() { assertFalse(userService.delete("user")); } @@ -85,16 +87,19 @@ public class UserServiceTest extends AbstractServiceSupport { assertNull(userService.findByName(null)); } + @Test public void testIsUserHasExactRight() { Right right = rightService.findByName("parent").get(0); assertTrue(userService.isUserHasRight("user", right)); } + @Test public void testIsUserHasRightByParents() { Right right = rightService.findByName("sibling").get(0); assertTrue(userService.isUserHasRight("user", right)); } + @Test public void testIsUserHasNotTheExactRight() { Right right = rightService.findByName("not-for-me").get(0); assertFalse(userService.isUserHasRight("user", right)); -- libgit2 0.21.2