From 3554f0dddfbacee2e11c6c73ca084cfca1d2bb2d Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 14 Aug 2013 17:43:52 +0200 Subject: SONAR-4475 Add method to check that at least one admin exists --- .../java/org/sonar/api/utils/MessageExceptionTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java') 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(); + } } -- cgit v1.2.3