diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileServiceMediumTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileServiceMediumTest.java index 49b7d947092..6985b4815df 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileServiceMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileServiceMediumTest.java @@ -282,4 +282,16 @@ public class QProfileServiceMediumTest { , new QueryOptions()).getHits()).hasSize(2); } + @Test + public void set_default() throws Exception { + MockUserSession.set().setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN).setLogin("me"); + + assertThat(service.getDefault("xoo")).isNull(); + + service.setDefault(XOO_P1_KEY); + dbSession.clearCache(); + + assertThat(service.getDefault("xoo").getKey()).isEqualTo(XOO_P1_KEY); + } + } |