diff --git a/src/main/java/fr/plil/sio/persistence/api/GroupService.java b/src/main/java/fr/plil/sio/persistence/api/GroupService.java index 72daae3..9e85f4b 100644 --- a/src/main/java/fr/plil/sio/persistence/api/GroupService.java +++ b/src/main/java/fr/plil/sio/persistence/api/GroupService.java @@ -4,12 +4,12 @@ public interface GroupService { /** * Create a group with a specific name in the database. - * There is no two groups with the same name in the database. + * There is no two groups with the same name or the same ID in the database. * * @param name the name of the group * @return an instance of the group * @throws IllegalArgumentException if name is null - * @throws IllegalStateException if a group with the same name is already present + * @throws IllegalStateException if a group with the same name is already present */ Group create(String name); @@ -32,7 +32,7 @@ public interface GroupService { Group findByName(String name); /** - * Add a right in the group. Right is inserted at the end of rights list of the group. + * Add a right in the group. * * @param groupName the name of the group. * @param right the right to add diff --git a/src/main/java/fr/plil/sio/persistence/api/UserService.java b/src/main/java/fr/plil/sio/persistence/api/UserService.java index 9bad49f..f488e6f 100644 --- a/src/main/java/fr/plil/sio/persistence/api/UserService.java +++ b/src/main/java/fr/plil/sio/persistence/api/UserService.java @@ -6,7 +6,7 @@ public interface UserService { * Create an user with a specific name in the database and affected to an existing group. * There is no two users with the same name in the database. * - * @param name the name of the user + * @param name the name of the user * @param groupName the name of the group * @return an instance of the user * @throws IllegalArgumentException if name or groupName is null, or if group does not exist. diff --git a/src/test/java/fr/plil/sio/persistence/jpa/RightServiceTest.java b/src/test/java/fr/plil/sio/persistence/jpa/RightServiceTest.java index f6d0b4c..c214d9e 100644 --- a/src/test/java/fr/plil/sio/persistence/jpa/RightServiceTest.java +++ b/src/test/java/fr/plil/sio/persistence/jpa/RightServiceTest.java @@ -90,7 +90,7 @@ public class RightServiceTest { public void testDeleteRightIfNotInDatabase() { Right right = new Right(); right.setName("not-a-right"); - assertFalse(rightService.delete(right)); + rightService.delete(right); } @Test(expected = IllegalArgumentException.class) diff --git a/src/test/java/fr/plil/sio/persistence/jpa/UserServiceTest.java b/src/test/java/fr/plil/sio/persistence/jpa/UserServiceTest.java index 89e94e6..55d79f8 100644 --- a/src/test/java/fr/plil/sio/persistence/jpa/UserServiceTest.java +++ b/src/test/java/fr/plil/sio/persistence/jpa/UserServiceTest.java @@ -70,6 +70,7 @@ public class UserServiceTest { @Test public void testDeleteUserIfNotFound() { + userService.delete("user"); assertFalse(userService.delete("user")); } diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index d744dce..7db6022 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -2,4 +2,4 @@ logging.level.org.springframework=INFO logging.level.org.hibernate.SQL=DEBUG logging.level.org.hibernate=INFO spring.datasource.url=jdbc:h2:mem:persistence;TRACE_LEVEL_FILE=4; -spring.datasource.tomcat.max-active=300 \ No newline at end of file +spring.datasource.tomcat.max-active=500 \ No newline at end of file -- libgit2 0.21.2