From 2ca24a31fd39e72f582d173d848a3a4956d486f6 Mon Sep 17 00:00:00 2001 From: pivovarit Date: Mon, 28 Nov 2016 19:31:43 +0100 Subject: [PATCH] Refactor tests --- .../java/nio2/attributes/BasicAttribsTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core-java/src/test/java/com/baeldung/java/nio2/attributes/BasicAttribsTest.java b/core-java/src/test/java/com/baeldung/java/nio2/attributes/BasicAttribsTest.java index dcc24c6415..8fc01ef85b 100644 --- a/core-java/src/test/java/com/baeldung/java/nio2/attributes/BasicAttribsTest.java +++ b/core-java/src/test/java/com/baeldung/java/nio2/attributes/BasicAttribsTest.java @@ -1,7 +1,7 @@ package com.baeldung.java.nio2.attributes; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import org.junit.BeforeClass; +import org.junit.Test; import java.io.IOException; 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.FileTime; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; public class BasicAttribsTest { private static final String HOME = System.getProperty("user.home"); - BasicFileAttributes basicAttribs; + private static BasicFileAttributes basicAttribs; - @Before - public void setup() throws IOException { + @BeforeClass + public static void setup() throws IOException { Path home = Paths.get(HOME); BasicFileAttributeView basicView = Files.getFileAttributeView(home, BasicFileAttributeView.class); basicAttribs = basicView.readAttributes();