[update] Update to junit 5
This commit is contained in:
parent
8b0efef54f
commit
1f642ec91d
@ -33,11 +33,11 @@ package net.bigeon.gclc.system;
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
* #L%
|
||||
*/
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.bigeon.gclc.exception.CommandRunException;
|
||||
import net.bigeon.gclc.manager.ConsoleInput;
|
||||
@ -51,10 +51,10 @@ public class ExecSystemCommandTest {
|
||||
@Test
|
||||
public void testExecSystemCommand() {
|
||||
final ExecSystemCommand cmd = new ExecSystemCommand("test");
|
||||
assertEquals("Name should be preserved", "test", cmd.getCommandName());
|
||||
assertNotNull("tip should be defined", cmd.tip());
|
||||
assertNotNull("usage should be defined", cmd.usagePattern());
|
||||
assertNotNull("usage should be defined", cmd.usageDetail());
|
||||
assertEquals("test", cmd.getCommandName(), "Name should be preserved");
|
||||
assertNotNull(cmd.tip(), "tip should be defined");
|
||||
assertNotNull(cmd.usagePattern(), "usage should be defined");
|
||||
assertNotNull(cmd.usageDetail(), "usage should be detailed");
|
||||
}
|
||||
|
||||
/** Test the execution of the command.
|
||||
|
@ -3,13 +3,13 @@
|
||||
*/
|
||||
package net.bigeon.gclc.system;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import net.bigeon.gclc.exception.CommandRunException;
|
||||
@ -27,8 +27,8 @@ public class ForwardingRunnableTest {
|
||||
// Runnable should close immediatly.
|
||||
runnable.run();
|
||||
|
||||
assertTrue("Error should be a CommandRunException",
|
||||
runnable.getError() instanceof CommandRunException);
|
||||
assertInstanceOf(CommandRunException.class, runnable.getError(),
|
||||
"Error should be a CommandRunException");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -39,6 +39,6 @@ public class ForwardingRunnableTest {
|
||||
is);
|
||||
// Runnable should close immediatly.
|
||||
runnable.run();
|
||||
assertTrue("Error should be an IO", runnable.getError() instanceof IOException);
|
||||
assertInstanceOf(IOException.class, runnable.getError(), "Error should be an IO");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user