This is an automated email from the ASF dual-hosted git repository. rcordier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 5c9da37670fde0cd3b973d25bb147b25d30be9a9 Author: Rene Cordier <rcord...@linagora.com> AuthorDate: Thu Aug 13 15:21:32 2020 +0700 [Refactoring] Migrate AccountIdTest to JUnit5 --- .../james/jmap/api/vacation/AccountIdTest.java | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/server/data/data-jmap/src/test/java/org/apache/james/jmap/api/vacation/AccountIdTest.java b/server/data/data-jmap/src/test/java/org/apache/james/jmap/api/vacation/AccountIdTest.java index 4362273..ac4aa25 100644 --- a/server/data/data-jmap/src/test/java/org/apache/james/jmap/api/vacation/AccountIdTest.java +++ b/server/data/data-jmap/src/test/java/org/apache/james/jmap/api/vacation/AccountIdTest.java @@ -20,25 +20,27 @@ package org.apache.james.jmap.api.vacation; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AccountIdTest { +class AccountIdTest { + static final String IDENTIFIER = "id"; - public static final String IDENTIFIER = "id"; - - @Test(expected = IllegalArgumentException.class) - public void createShouldThrowOnNullIdentifier() { - AccountId.fromString(null); + @Test + void createShouldThrowOnNullIdentifier() { + assertThatThrownBy(() -> AccountId.fromString(null)) + .isInstanceOf(IllegalArgumentException.class); } - @Test(expected = IllegalArgumentException.class) - public void createShouldThrowOnEmptyIdentifier() { - AccountId.fromString(""); + @Test + void createShouldThrowOnEmptyIdentifier() { + assertThatThrownBy(() -> AccountId.fromString("")) + .isInstanceOf(IllegalArgumentException.class); } @Test - public void createShouldWork() { + void createShouldWork() { assertThat(AccountId.fromString(IDENTIFIER).getIdentifier()).isEqualTo(IDENTIFIER); } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org