james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [01/12] james-project git commit: JAMES-2161 Fix some intelliJ warnings in Keyword related test
Date Tue, 27 Nov 2018 02:06:28 GMT
Repository: james-project
Updated Branches:
  refs/heads/master 92a41825d -> edac1840a


JAMES-2161 Fix some intelliJ warnings in Keyword related test


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/34aad5b4
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/34aad5b4
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/34aad5b4

Branch: refs/heads/master
Commit: 34aad5b44545b8b77dfc2544d58eabab889c397a
Parents: 20a1527
Author: Benoit Tellier <btellier@linagora.com>
Authored: Fri Nov 23 10:05:44 2018 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Tue Nov 27 09:01:33 2018 +0700

----------------------------------------------------------------------
 .../apache/james/jmap/model/KeywordTest.java    | 50 ++++++++++----------
 .../apache/james/jmap/model/KeywordsTest.java   | 28 +++++------
 .../james/jmap/utils/KeywordsCombinerTest.java  |  2 +-
 3 files changed, 40 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/34aad5b4/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/KeywordTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/KeywordTest.java
b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/KeywordTest.java
index 2d1e857..eac399a 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/KeywordTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/KeywordTest.java
@@ -46,19 +46,19 @@ public class KeywordTest {
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameLengthLessThanMinLength() throws Exception
{
+    public void keywordShouldThrowWhenFlagNameLengthLessThanMinLength() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of("");
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameLengthMoreThanMaxLength() throws Exception
{
+    public void keywordShouldThrowWhenFlagNameLengthMoreThanMaxLength() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of(StringUtils.repeat("a", FLAG_NAME_MAX_LENTH + 1));
     }
 
     @Test
-    public void keywordShouldCreateNewOneWhenFlagNameLengthEqualsMaxLength() throws Exception
{
+    public void keywordShouldCreateNewOneWhenFlagNameLengthEqualsMaxLength() {
         String maxLengthFlagName = StringUtils.repeat("a", FLAG_NAME_MAX_LENTH);
         Keyword keyword = Keyword.of(maxLengthFlagName);
 
@@ -66,7 +66,7 @@ public class KeywordTest {
     }
 
     @Test
-    public void keywordShouldCreateNewOneWhenFlagNameLengthEqualsMinLength() throws Exception
{
+    public void keywordShouldCreateNewOneWhenFlagNameLengthEqualsMinLength() {
         String minLengthFlagName = "a";
         Keyword keyword = Keyword.of(minLengthFlagName);
 
@@ -74,123 +74,123 @@ public class KeywordTest {
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameContainsPercentageCharacter() throws Exception
{
+    public void keywordShouldThrowWhenFlagNameContainsPercentageCharacter() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of("a%");
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameContainsLeftBracket() throws Exception {
+    public void keywordShouldThrowWhenFlagNameContainsLeftBracket() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of("a[");
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameContainsRightBracket() throws Exception {
+    public void keywordShouldThrowWhenFlagNameContainsRightBracket() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of("a]");
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameContainsLeftBrace() throws Exception {
+    public void keywordShouldThrowWhenFlagNameContainsLeftBrace() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of("a{");
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameContainsSlash() throws Exception {
+    public void keywordShouldThrowWhenFlagNameContainsSlash() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of("a\\");
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameContainsStar() throws Exception {
+    public void keywordShouldThrowWhenFlagNameContainsStar() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of("a*");
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameContainsQuote() throws Exception {
+    public void keywordShouldThrowWhenFlagNameContainsQuote() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of("a\"");
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameContainsOpeningParenthesis() throws Exception
{
+    public void keywordShouldThrowWhenFlagNameContainsOpeningParenthesis() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of("a(");
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameContainsClosingParenthesis() throws Exception
{
+    public void keywordShouldThrowWhenFlagNameContainsClosingParenthesis() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of("a)");
     }
 
     @Test
-    public void keywordShouldThrowWhenFlagNameContainsSpaceCharacter() throws Exception {
+    public void keywordShouldThrowWhenFlagNameContainsSpaceCharacter() {
         expectedException.expect(IllegalArgumentException.class);
         Keyword.of("a b");
     }
 
     @Test
-    public void isNotNonExposedImapKeywordShouldReturnFalseWhenDeleted() throws Exception
{
+    public void isNotNonExposedImapKeywordShouldReturnFalseWhenDeleted() {
         assertThat(Keyword.DELETED.isExposedImapKeyword()).isFalse();
     }
 
     @Test
-    public void isNotNonExposedImapKeywordShouldReturnFalseWhenRecent() throws Exception
{
+    public void isNotNonExposedImapKeywordShouldReturnFalseWhenRecent() {
         assertThat(Keyword.RECENT.isExposedImapKeyword()).isFalse();
     }
 
     @Test
-    public void isNotNonExposedImapKeywordShouldReturnTrueWhenOtherSystemFlag() throws Exception
{
+    public void isNotNonExposedImapKeywordShouldReturnTrueWhenOtherSystemFlag() {
         assertThat(Keyword.DRAFT.isExposedImapKeyword()).isTrue();
     }
 
     @Test
-    public void isNotNonExposedImapKeywordShouldReturnTrueWhenAnyUserFlag() throws Exception
{
+    public void isNotNonExposedImapKeywordShouldReturnTrueWhenAnyUserFlag() {
         Keyword keyword = Keyword.of(ANY_KEYWORD);
         assertThat(keyword.isExposedImapKeyword()).isTrue();
     }
 
     @Test
-    public void isDraftShouldReturnTrueWhenDraft() throws Exception {
+    public void isDraftShouldReturnTrueWhenDraft() {
         assertThat(Keyword.DRAFT.isDraft()).isTrue();
     }
 
     @Test
-    public void isDraftShouldReturnFalseWhenNonDraft() throws Exception {
+    public void isDraftShouldReturnFalseWhenNonDraft() {
         assertThat(Keyword.DELETED.isDraft()).isFalse();
     }
 
     @Test
-    public void asSystemFlagShouldReturnSystemFlag() throws Exception {
+    public void asSystemFlagShouldReturnSystemFlag() {
         assertThat(Keyword.of("$Draft").asSystemFlag())
             .isEqualTo(Optional.of(Flags.Flag.DRAFT));
     }
 
     @Test
-    public void asSystemFlagShouldReturnEmptyWhenNonSystemFlag() throws Exception {
+    public void asSystemFlagShouldReturnEmptyWhenNonSystemFlag() {
         assertThat(Keyword.of(ANY_KEYWORD).asSystemFlag().isPresent())
             .isFalse();
     }
 
     @Test
-    public void asFlagsShouldReturnFlagsWhenSystemFlag() throws Exception {
+    public void asFlagsShouldReturnFlagsWhenSystemFlag() {
         assertThat(Keyword.DELETED.asFlags())
             .isEqualTo(new Flags(Flags.Flag.DELETED));
     }
 
     @Test
-    public void asFlagsShouldReturnFlagsWhenUserFlag() throws Exception {
+    public void asFlagsShouldReturnFlagsWhenUserFlag() {
         Keyword keyword = Keyword.of(ANY_KEYWORD);
         assertThat(keyword.asFlags())
             .isEqualTo(new Flags(ANY_KEYWORD));
     }
 
     @Test
-    public void asFlagsShouldReturnFlagsWhenUserFlagContainsUnderscore() throws Exception
{
+    public void asFlagsShouldReturnFlagsWhenUserFlagContainsUnderscore() {
         String userFlag = "$has_cal";
         Keyword keyword = Keyword.of(userFlag);
         assertThat(keyword.asFlags())

http://git-wip-us.apache.org/repos/asf/james-project/blob/34aad5b4/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/KeywordsTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/KeywordsTest.java
b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/KeywordsTest.java
index ab026a3..43b45a7 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/KeywordsTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/model/KeywordsTest.java
@@ -48,7 +48,7 @@ public class KeywordsTest {
     }
 
     @Test
-    public void fromMapShouldThrowWhenWrongKeywordValue() throws Exception {
+    public void fromMapShouldThrowWhenWrongKeywordValue() {
         expectedException.expect(IllegalArgumentException.class);
 
         Keywords.factory()
@@ -56,7 +56,7 @@ public class KeywordsTest {
     }
 
     @Test
-    public void fromMapShouldReturnKeywordsFromMapStringAndBoolean() throws Exception {
+    public void fromMapShouldReturnKeywordsFromMapStringAndBoolean() {
         Keywords keywords = Keywords.factory()
             .fromMap(ImmutableMap.of(ANY_KEYWORD, Keyword.FLAG_VALUE));
 
@@ -65,7 +65,7 @@ public class KeywordsTest {
     }
 
     @Test
-    public void fromFlagsShouldReturnKeywordsFromAllFlag() throws Exception {
+    public void fromFlagsShouldReturnKeywordsFromAllFlag() {
         Keywords keywords = Keywords.factory()
             .fromFlags(new Flags(Flags.Flag.ANSWERED));
 
@@ -74,7 +74,7 @@ public class KeywordsTest {
     }
 
     @Test
-    public void fromSetShouldReturnKeywordsFromSetOfKeywords() throws Exception {
+    public void fromSetShouldReturnKeywordsFromSetOfKeywords() {
         Keywords keywords = Keywords.factory()
             .fromSet(ImmutableSet.of(Keyword.ANSWERED));
 
@@ -83,7 +83,7 @@ public class KeywordsTest {
     }
 
     @Test
-    public void asFlagsShouldBuildFlagsFromKeywords() throws Exception {
+    public void asFlagsShouldBuildFlagsFromKeywords() {
         assertThat(Keywords.factory()
                 .fromSet(ImmutableSet.of(Keyword.ANSWERED))
                 .asFlags())
@@ -91,7 +91,7 @@ public class KeywordsTest {
     }
 
     @Test
-    public void asFlagsWithRecentAndDeletedFromShouldBuildFlagsFromKeywordsAndRecentOriginFlags()
throws Exception {
+    public void asFlagsWithRecentAndDeletedFromShouldBuildFlagsFromKeywordsAndRecentOriginFlags()
{
         Flags originFlags = FlagsBuilder.builder()
             .add(Flag.RECENT, Flag.DRAFT)
             .build();
@@ -107,7 +107,7 @@ public class KeywordsTest {
     }
 
     @Test
-    public void asFlagsWithRecentAndDeletedFromShouldBuildFlagsFromKeywordsWithDeletedAndRecentOriginFlags()
throws Exception {
+    public void asFlagsWithRecentAndDeletedFromShouldBuildFlagsFromKeywordsWithDeletedAndRecentOriginFlags()
{
         Flags originFlags = FlagsBuilder.builder()
             .add(Flag.RECENT, Flag.DELETED, Flag.DRAFT)
             .build();
@@ -123,15 +123,15 @@ public class KeywordsTest {
     }
 
     @Test
-    public void asMapShouldReturnEmptyWhenEmptyMapOfStringAndBoolean() throws Exception {
+    public void asMapShouldReturnEmptyWhenEmptyMapOfStringAndBoolean() {
         assertThat(Keywords.factory()
                 .fromSet(ImmutableSet.of())
                 .asMap())
-            .isEmpty();;
+            .isEmpty();
     }
 
     @Test
-    public void asMapShouldReturnMapOfStringAndBoolean() throws Exception {
+    public void asMapShouldReturnMapOfStringAndBoolean() {
         Map<String, Boolean> expectedMap = ImmutableMap.of("$Answered", Keyword.FLAG_VALUE);
         assertThat(Keywords.factory()
                 .fromSet(ImmutableSet.of(Keyword.ANSWERED))
@@ -140,7 +140,7 @@ public class KeywordsTest {
     }
 
     @Test
-    public void throwWhenUnsupportedKeywordShouldThrowWhenHaveUnsupportedKeywords() throws
Exception {
+    public void throwWhenUnsupportedKeywordShouldThrowWhenHaveUnsupportedKeywords() {
         expectedException.expect(IllegalArgumentException.class);
 
         Keywords.factory()
@@ -149,7 +149,7 @@ public class KeywordsTest {
     }
 
     @Test
-    public void throwWhenUnsupportedKeywordShouldNotThrowWhenHaveDraft() throws Exception
{
+    public void throwWhenUnsupportedKeywordShouldNotThrowWhenHaveDraft() {
         Keywords keywords = Keywords.factory()
             .throwOnImapNonExposedKeywords()
             .fromSet(ImmutableSet.of(Keyword.ANSWERED, Keyword.DRAFT));
@@ -159,7 +159,7 @@ public class KeywordsTest {
     }
 
     @Test
-    public void filterUnsupportedShouldFilter() throws Exception {
+    public void filterUnsupportedShouldFilter() {
         Keywords keywords = Keywords.factory()
             .filterImapNonExposedKeywords()
             .fromSet(ImmutableSet.of(Keyword.ANSWERED, Keyword.DELETED, Keyword.RECENT, Keyword.DRAFT));
@@ -185,7 +185,7 @@ public class KeywordsTest {
     }
 
     @Test
-    public void fromListShouldReturnKeywordsFromListOfStrings() throws Exception {
+    public void fromListShouldReturnKeywordsFromListOfStrings() {
         Keywords keywords = Keywords.factory()
             .fromList(ImmutableList.of("$Answered", "$Flagged"));
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/34aad5b4/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/KeywordsCombinerTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/KeywordsCombinerTest.java
b/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/KeywordsCombinerTest.java
index a7bb19c..5acb625 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/KeywordsCombinerTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/KeywordsCombinerTest.java
@@ -30,7 +30,7 @@ import com.google.common.collect.ImmutableSet;
 
 public class KeywordsCombinerTest {
 
-    public static final Keywords.KeywordsFactory FACTORY = Keywords.factory();
+    private static final Keywords.KeywordsFactory FACTORY = Keywords.factory();
 
     @Test
     public void applyShouldUnionSeenKeyword() {


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message