diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-08-14 17:43:52 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-08-14 17:43:52 +0200 |
commit | 3554f0dddfbacee2e11c6c73ca084cfca1d2bb2d (patch) | |
tree | c2e7589d13472c943be9934a66e4470bf3f925b1 /sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java | |
parent | adde7cf9216f9a0ccf78409078838d826d816f4a (diff) | |
download | sonarqube-3554f0dddfbacee2e11c6c73ca084cfca1d2bb2d.tar.gz sonarqube-3554f0dddfbacee2e11c6c73ca084cfca1d2bb2d.zip |
SONAR-4475 Add method to check that at least one admin exists
Diffstat (limited to 'sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java')
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java index 0b734416e94..f036069412f 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java @@ -47,4 +47,18 @@ public class MessageExceptionTest { assertThat(writer.toString()).isEqualTo(message + System.getProperty("line.separator")); } } + + @Test + public void should_create_exception_with_status_and_l10n_message_with_param(){ + MessageException exception = new MessageException(null, "key", new String[]{"value"}); + assertThat(exception.l10nKey()).isEqualTo("key"); + assertThat(exception.l10nParams()).containsOnly("value"); + } + + @Test + public void should_create_exception_with_status_and_l10n_message_without_param(){ + MessageException exception = new MessageException(null, "key", null); + assertThat(exception.l10nKey()).isEqualTo("key"); + assertThat(exception.l10nParams()).isEmpty(); + } } |