Skip to content

Commit f7016c5

Browse files
committed
Resue RandomAccessFileMode.READ_WRITE.create() instead of a magic string
1 parent b4b99af commit f7016c5

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ limitations under the License.
235235
<version>3.12.0</version>
236236
<scope>test</scope>
237237
</dependency>
238+
<dependency>
239+
<groupId>commons-io</groupId>
240+
<artifactId>commons-io</artifactId>
241+
<version>2.13.0</version>
242+
<scope>test</scope>
243+
</dependency>
238244
<dependency>
239245
<groupId>org.hamcrest</groupId>
240246
<artifactId>hamcrest</artifactId>

src/test/java/org/apache/commons/codec/digest/DigestUtilsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
import org.apache.commons.codec.binary.Hex;
4444
import org.apache.commons.codec.binary.StringUtils;
45+
import org.apache.commons.io.RandomAccessFileMode;
4546
import org.apache.commons.lang3.JavaVersion;
4647
import org.apache.commons.lang3.SystemUtils;
4748
import org.junit.jupiter.api.AfterEach;
@@ -95,7 +96,7 @@ public void setUp() throws Exception {
9596
try (final OutputStream fos = Files.newOutputStream(testRandomAccessFile)) {
9697
fos.write(testData);
9798
}
98-
testRandomAccessFileWrapper = new RandomAccessFile(testRandomAccessFile.toFile(), "rw");
99+
testRandomAccessFileWrapper = RandomAccessFileMode.READ_WRITE.create(testRandomAccessFile);
99100
}
100101

101102
@AfterEach

0 commit comments

Comments
 (0)