Skip to content

Commit

Permalink
devonfw#78: tmp file to context.getFileAccess().createTempDir didnt w…
Browse files Browse the repository at this point in the history
…ork on github, so now tmp file to target dir
  • Loading branch information
MattesMrzik committed Oct 20, 2023
1 parent fdb6fde commit 7a63186
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

import com.devonfw.tools.ide.context.IdeContext;
import com.devonfw.tools.ide.context.IdeTestContext;
import com.devonfw.tools.ide.log.IdeSlf4jRootLogger;

/**
Expand Down Expand Up @@ -65,9 +63,7 @@ void testSave() {
linesToWrite.add("# 5th comment");
linesToWrite.add("var9=9");

IdeContext context = new IdeTestContext(null);
Path tmpDir = context.getFileAccess().createTempDir("tmp-EnvironmentVariablesPropertiesFileTest");
Path propertiesFilePath = tmpDir.resolve("ide.properties");
Path propertiesFilePath = Path.of("target/tmp-EnvironmentVariablesPropertiesFileTest-ide.properties");
try {
Files.write(propertiesFilePath, linesToWrite, StandardOpenOption.CREATE_NEW);
} catch (IOException e) {
Expand Down Expand Up @@ -131,6 +127,10 @@ void testSave() {
}

// clean up
context.getFileAccess().delete(tmpDir);
try {
Files.delete(propertiesFilePath);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}

0 comments on commit 7a63186

Please sign in to comment.