Refactor tests
This commit is contained in:
parent
7d09a2c3df
commit
2ca24a31fd
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue