diff --git a/src/test/java/mpo/dayon/common/RunnerTest.java b/src/test/java/mpo/dayon/common/RunnerTest.java index 2735e4a7..6a386f5f 100644 --- a/src/test/java/mpo/dayon/common/RunnerTest.java +++ b/src/test/java/mpo/dayon/common/RunnerTest.java @@ -69,8 +69,8 @@ void shouldExtractProgramArgs() { Map programArgs = extractProgramArgs(args); // then assertEquals(2, programArgs.size(), "Unexpected number of extracted ProgramArgs"); - assertEquals("en", programArgs.get("lang"), "Key 'lang' shold have value 'en'"); - assertEquals("BAR", programArgs.get("foo"), "Key 'foo' shold have value 'BAR'"); + assertEquals("en", programArgs.get("lang"), "Key 'lang' should have value 'en'"); + assertEquals("BAR", programArgs.get("foo"), "Key 'foo' should have value 'BAR'"); } @Test diff --git a/src/test/java/mpo/dayon/common/buffer/MemByteBufferTest.java b/src/test/java/mpo/dayon/common/buffer/MemByteBufferTest.java index af9655b6..04546b76 100644 --- a/src/test/java/mpo/dayon/common/buffer/MemByteBufferTest.java +++ b/src/test/java/mpo/dayon/common/buffer/MemByteBufferTest.java @@ -23,6 +23,14 @@ void tearDown() throws IOException { buffer.close(); } + @Test + void write() { + final int val = 234; + buffer.write(val); + assertEquals(1, buffer.size()); + assertEquals((byte) val, buffer.getInternal()[0]); + } + @Test void writeInt() { buffer.writeInt(BEAST); diff --git a/src/test/java/mpo/dayon/common/utils/SystemUtilitiesTest.java b/src/test/java/mpo/dayon/common/utils/SystemUtilitiesTest.java index cb1fcd19..b3be6210 100644 --- a/src/test/java/mpo/dayon/common/utils/SystemUtilitiesTest.java +++ b/src/test/java/mpo/dayon/common/utils/SystemUtilitiesTest.java @@ -1,5 +1,6 @@ package mpo.dayon.common.utils; +import static java.lang.String.format; import static mpo.dayon.common.utils.SystemUtilities.*; import static org.junit.jupiter.api.Assertions.*; @@ -7,6 +8,10 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; import java.security.NoSuchAlgorithmException; class SystemUtilitiesTest { @@ -105,4 +110,17 @@ void isValidPortNumberShouldReturnTrueForValidPorts(String port) { // when, then assertTrue(isValidPortNumber(port)); } + + @Test + void shouldObtainWritableTempDir() throws IOException { + // when, then + assertTrue(Files.isWritable(new File(getTempDir()).toPath()), "TempDir should be writable"); + } + + @Test + void shouldObtainJarDir() throws IOException { + // when, then + assertTrue(new File(format("%s%sdayon.jar", getJarDir(), File.separator)).exists(), "JarDir should contain dayon.jar"); + } + }