Refactor tests

This commit is contained in:
pivovarit 2016-11-28 19:31:43 +01:00
parent 7d09a2c3df
commit 2ca24a31fd
1 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,7 @@
package com.baeldung.java.nio2.attributes; package com.baeldung.java.nio2.attributes;
import static org.junit.Assert.assertFalse; import org.junit.BeforeClass;
import static org.junit.Assert.assertTrue; import org.junit.Test;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
@ -11,15 +11,15 @@ import java.nio.file.attribute.BasicFileAttributeView;
import java.nio.file.attribute.BasicFileAttributes; import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileTime; import java.nio.file.attribute.FileTime;
import org.junit.Before; import static org.junit.Assert.assertFalse;
import org.junit.Test; import static org.junit.Assert.assertTrue;
public class BasicAttribsTest { public class BasicAttribsTest {
private static final String HOME = System.getProperty("user.home"); private static final String HOME = System.getProperty("user.home");
BasicFileAttributes basicAttribs; private static BasicFileAttributes basicAttribs;
@Before @BeforeClass
public void setup() throws IOException { public static void setup() throws IOException {
Path home = Paths.get(HOME); Path home = Paths.get(HOME);
BasicFileAttributeView basicView = Files.getFileAttributeView(home, BasicFileAttributeView.class); BasicFileAttributeView basicView = Files.getFileAttributeView(home, BasicFileAttributeView.class);
basicAttribs = basicView.readAttributes(); basicAttribs = basicView.readAttributes();