diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2013-11-28 15:51:15 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2013-11-28 15:51:15 +0100 |
commit | 399d6490aa8b0d88fcfb4a0d9e40618e40c79389 (patch) | |
tree | 00c017f56f8d38e62ff10ae8716831fd7ebfe5c6 /sonar-server | |
parent | 4d0e95eb3b2785571b2a75e2ec95bd23b0a38053 (diff) | |
download | sonarqube-399d6490aa8b0d88fcfb4a0d9e40618e40c79389.tar.gz sonarqube-399d6490aa8b0d88fcfb4a0d9e40618e40c79389.zip |
SONAR-2447 Fix UT
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/test/java/org/sonar/server/startup/RegisterPermissionTemplatesTest.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sonar-server/src/test/java/org/sonar/server/startup/RegisterPermissionTemplatesTest.java b/sonar-server/src/test/java/org/sonar/server/startup/RegisterPermissionTemplatesTest.java index 8a70eaa162b..0dd078f8547 100644 --- a/sonar-server/src/test/java/org/sonar/server/startup/RegisterPermissionTemplatesTest.java +++ b/sonar-server/src/test/java/org/sonar/server/startup/RegisterPermissionTemplatesTest.java @@ -34,8 +34,14 @@ import org.sonar.core.user.GroupDto; import org.sonar.core.user.UserDao; import org.sonar.server.platform.PersistentSettings; +import static org.mockito.Matchers.any; import static org.mockito.Matchers.argThat; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.when; public class RegisterPermissionTemplatesTest { @@ -71,6 +77,7 @@ public class RegisterPermissionTemplatesTest { verify(loadedTemplateDao).insert(argThat(Matches.template(expectedTemplate))); verify(permissionTemplateDao).createPermissionTemplate(PermissionTemplateDto.DEFAULT.getName(), PermissionTemplateDto.DEFAULT.getDescription()); verify(permissionTemplateDao).addGroupPermission(1L, 1L, UserRole.ADMIN); + verify(permissionTemplateDao).addGroupPermission(1L, 1L, UserRole.ISSUE_ADMIN); verify(permissionTemplateDao).addGroupPermission(1L, null, UserRole.USER); verify(permissionTemplateDao).addGroupPermission(1L, null, UserRole.CODEVIEWER); verifyNoMoreInteractions(permissionTemplateDao); @@ -118,7 +125,7 @@ public class RegisterPermissionTemplatesTest { @Override public boolean matches(Object o) { - if(o != null && o instanceof LoadedTemplateDto) { + if (o != null && o instanceof LoadedTemplateDto) { LoadedTemplateDto otherTemplate = (LoadedTemplateDto) o; return referenceTemplate.getKey().equals(otherTemplate.getKey()) && referenceTemplate.getType().equals(otherTemplate.getType()); |