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 00139201c977ed1088f9340a31145a71a70b4d5a Author: Rene Cordier <[email protected]> AuthorDate: Fri Jul 31 17:02:53 2020 +0700 [Refactoring] Migrate TestScriptedUserAdder to JUnit5 --- .../apache/james/mpt/TestScriptedUserAdder.java | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/mpt/core/src/test/java/org/apache/james/mpt/TestScriptedUserAdder.java b/mpt/core/src/test/java/org/apache/james/mpt/TestScriptedUserAdder.java index b490e3d..e7b4b60 100644 --- a/mpt/core/src/test/java/org/apache/james/mpt/TestScriptedUserAdder.java +++ b/mpt/core/src/test/java/org/apache/james/mpt/TestScriptedUserAdder.java @@ -23,32 +23,33 @@ import static org.assertj.core.api.Assertions.assertThat; import org.apache.james.core.Username; import org.apache.james.mpt.user.ScriptedUserAdder; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class TestScriptedUserAdder { +class TestScriptedUserAdder { - private DiscardProtocol protocol; + DiscardProtocol protocol; - private DiscardProtocol.Record record; + DiscardProtocol.Record record; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { protocol = new DiscardProtocol(); protocol.start(); record = protocol.recordNext(); } - @After - public void tearDown() throws Exception { + @AfterEach + void tearDown() { protocol.stop(); } @Test - public void testShouldExecuteScriptAgainstPort() throws Exception { + void testShouldExecuteScriptAgainstPort() throws Exception { ScriptedUserAdder adder = new ScriptedUserAdder("localhost", protocol.getPort(), "C: USER='${user}' password='${password}'"); adder.addUser(Username.of("user"), "Some Password"); + assertThat(record.complete()).isEqualTo("USER='user' password='Some Password'\r\n"); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
