Use unix configuration in jimfs tests

Signed-off-by: Major <major@emulate.rs>
bzip2
Major 5 years ago
parent 282dbd268b
commit 34507a92db
  1. 9
      common/src/test/java/dev/openrs2/common/crypto/RsaTest.kt

@ -1,5 +1,6 @@
package dev.openrs2.common.crypto package dev.openrs2.common.crypto
import com.google.common.jimfs.Configuration
import com.google.common.jimfs.Jimfs import com.google.common.jimfs.Jimfs
import io.netty.buffer.Unpooled import io.netty.buffer.Unpooled
import org.bouncycastle.crypto.params.RSAKeyParameters import org.bouncycastle.crypto.params.RSAKeyParameters
@ -114,7 +115,7 @@ object RsaTest {
@Test @Test
fun testReadPublicKey() { fun testReadPublicKey() {
Jimfs.newFileSystem().use { fs -> Jimfs.newFileSystem(Configuration.unix()).use { fs ->
val file = Files.createTempFile(fs.getPath("/"), "public", ".key") val file = Files.createTempFile(fs.getPath("/"), "public", ".key")
try { try {
Files.write(file, PUBLIC_KEY_PEM) Files.write(file, PUBLIC_KEY_PEM)
@ -131,7 +132,7 @@ object RsaTest {
@Test @Test
fun testWritePublicKey() { fun testWritePublicKey() {
Jimfs.newFileSystem().use { fs -> Jimfs.newFileSystem(Configuration.unix()).use { fs ->
val file = Files.createTempFile(fs.getPath("/"), "public", ".key") val file = Files.createTempFile(fs.getPath("/"), "public", ".key")
try { try {
Rsa.writePublicKey(file, PUBLIC_KEY) Rsa.writePublicKey(file, PUBLIC_KEY)
@ -145,7 +146,7 @@ object RsaTest {
@Test @Test
fun testReadPrivateKey() { fun testReadPrivateKey() {
Jimfs.newFileSystem().use { fs -> Jimfs.newFileSystem(Configuration.unix()).use { fs ->
val file = Files.createTempFile(fs.getPath("/"), "private", ".key") val file = Files.createTempFile(fs.getPath("/"), "private", ".key")
try { try {
Files.write(file, PRIVATE_KEY_PEM) Files.write(file, PRIVATE_KEY_PEM)
@ -168,7 +169,7 @@ object RsaTest {
@Test @Test
fun testWritePrivateKey() { fun testWritePrivateKey() {
Jimfs.newFileSystem().use { fs -> Jimfs.newFileSystem(Configuration.unix()).use { fs ->
val file = Files.createTempFile(fs.getPath("/"), "private", ".key") val file = Files.createTempFile(fs.getPath("/"), "private", ".key")
try { try {
Rsa.writePrivateKey(file, PRIVATE_KEY_CRT) Rsa.writePrivateKey(file, PRIVATE_KEY_CRT)

Loading…
Cancel
Save