Skip to content
Snippets Groups Projects
Commit 0db699d5 authored by HSoreide's avatar HSoreide
Browse files

FileHandlingBudgetArchive unit tests running

parent 33023ae8
No related branches found
No related tags found
1 merge request!61Hs master pom file for executable jar
......@@ -22,11 +22,8 @@ import java.io.*;
* @since 19.04.2023
*/
public class FileHandlingBudgetArchive {
private static final String jarFilePath = "src/main/resources/";
private static final String fileType = ".archive";
private static final String path = System.getProperty("user.home");
private static final String filePath = path + "/BudgetBuddyFiles/";
private static final String fileType = ".archive";
/**
* Method for writing (adding) a budget register to the archive.
......@@ -40,10 +37,6 @@ public class FileHandlingBudgetArchive {
File file = new File(String.format("%s%s", fileDestination, fileType));
/* if (!file.exists()){
file.createNewFile();
}*/
try (BufferedWriter bw = new BufferedWriter(new FileWriter(fileDestination + fileType))) {
bw.write(budgetNames.toString());
} catch (IOException ioe) {
......
......@@ -27,7 +27,7 @@ public class FileHandlingBudgetArchiveTest {
@BeforeEach
void setUp() {
budgetRegister = new BudgetRegister();
filePath = "testFiles/budget/Archive";
filePath = "src/main/resources/testFiles/budget/Archive";
name1 = "APRIL1";
name2 = "APRIL2";
......@@ -73,8 +73,8 @@ public class FileHandlingBudgetArchiveTest {
@BeforeEach
void setUp() {
budgetRegister = new BudgetRegister();
filePath = "testFiles/budget/emptyFile";
filePath1 = "testFiles/budget/notEmptyFile";
filePath = "src/main/resources/testFiles/budget/emptyFile";
filePath1 = "src/main/resources/testFiles/budget/notEmptyFile";
}
@Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment