From 0265b4696bfb78e430d32b4123ccd85a694fbdf0 Mon Sep 17 00:00:00 2001 From: Jarek Sacha Date: Fri, 12 May 2023 23:23:38 -0400 Subject: [PATCH] Better tmp file creation --- .../net/ij_plugins/sf/sbt/install4j/DefaultsTest.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/scala/net/ij_plugins/sf/sbt/install4j/DefaultsTest.scala b/src/test/scala/net/ij_plugins/sf/sbt/install4j/DefaultsTest.scala index 1ac7308..a77fcd2 100644 --- a/src/test/scala/net/ij_plugins/sf/sbt/install4j/DefaultsTest.scala +++ b/src/test/scala/net/ij_plugins/sf/sbt/install4j/DefaultsTest.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 Jarek Sacha (jpsacha -at- gmail.com) + * Copyright 2014-2023 Jarek Sacha (jpsacha -at- gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,12 +19,12 @@ package net.ij_plugins.sf.sbt.install4j import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers.* -import java.io.File +import java.nio.file.Files class DefaultsTest extends AnyFlatSpec { it should "determine install4jHomeDir from environment variable" in { - val f = File.createTempFile("_env_", "_env_") + val f = Files.createTempFile("_env_", "_env_").toFile val path_name = f.getCanonicalPath System.setProperty(Defaults.INSTALL4J_HOME_ENV, path_name) @@ -34,7 +34,7 @@ class DefaultsTest extends AnyFlatSpec { } it should "determine install4jCompilerFile from environment variable" in { - val f = File.createTempFile("_env_", "_env_") + val f = Files.createTempFile("_env_", "_env_").toFile val path_name = f.getCanonicalPath System.setProperty(Defaults.INSTALL4JC_FILE_ENV, path_name)