remove throws NotFoundException and fix modify password

This commit is contained in:
Mohamed Karray
2018-10-16 10:47:52 +02:00
parent f94922837b
commit d2dbccb80c
23 changed files with 110 additions and 54 deletions

View File

@@ -71,7 +71,7 @@ public class ManagerDecorator<T extends ModelObject> implements Manager<T> {
}
@Override
public void delete(T object) throws NotFoundException {
public void delete(T object){
decorated.delete(object);
}
@@ -82,12 +82,12 @@ public class ManagerDecorator<T extends ModelObject> implements Manager<T> {
}
@Override
public void modify(T object) throws NotFoundException {
public void modify(T object){
decorated.modify(object);
}
@Override
public void refresh(T object) throws NotFoundException {
public void refresh(T object){
decorated.refresh(object);
}

View File

@@ -3,6 +3,7 @@ package sonia.scm.user;
public class ChangePasswordNotAllowedException extends RuntimeException {
public static final String WRONG_USER_TYPE = "User of type {0} are not allowed to change password";
public static final String OLD_PASSWORD_REQUIRED = "the old password is required.";
public ChangePasswordNotAllowedException(String message) {
super(message);

View File

@@ -154,7 +154,7 @@ public class SyncingRealmHelperTest {
* Tests {@link SyncingRealmHelper#store(Group)} with an existing group.
*/
@Test
public void testStoreGroupModify() throws NotFoundException {
public void testStoreGroupModify(){
Group group = new Group("unit-test", "heartOfGold");
when(groupManager.get("heartOfGold")).thenReturn(group);
@@ -191,7 +191,7 @@ public class SyncingRealmHelperTest {
* Tests {@link SyncingRealmHelper#store(User)} with an existing user.
*/
@Test
public void testStoreUserModify() throws NotFoundException {
public void testStoreUserModify(){
when(userManager.contains("tricia")).thenReturn(Boolean.TRUE);
User user = new User("tricia");