Skip to content

Commit

Permalink
removed unnecessary use of static temp dir (hyperledger#6251)
Browse files Browse the repository at this point in the history
* don't use static tempdir

Signed-off-by: Sally MacFarlane <[email protected]>

---------

Signed-off-by: Sally MacFarlane <[email protected]>
Signed-off-by: jflo <[email protected]>
  • Loading branch information
macfarla authored and jflo committed Dec 18, 2023
1 parent c44f447 commit a3ef0d8
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
@SuppressWarnings("rawtypes")
public class PrivacyReorgTest {

@TempDir private static Path folder;
@TempDir private Path folder;

private static final Supplier<SignatureAlgorithm> SIGNATURE_ALGORITHM =
Suppliers.memoize(SignatureAlgorithmFactory::getInstance);
Expand Down
2 changes: 1 addition & 1 deletion besu/src/test/java/org/hyperledger/besu/RunnerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void stopVertx() {
vertx.close();
}

@TempDir private static Path temp;
@TempDir private Path temp;

@Test
public void getFixedNodes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
import org.mockito.Mockito;

public abstract class AbstractEthGraphQLHttpServiceTest {
@TempDir private static Path tempDir;
@TempDir private Path tempDir;

private static BlockchainSetupUtil blockchainSetupUtil;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.mockito.Mockito;

public class GraphQLHttpServiceCorsTest {
@TempDir private static Path folder;
@TempDir private Path folder;

private final Vertx vertx = Vertx.vertx();
private final OkHttpClient client = new OkHttpClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

public class GraphQLHttpServiceHostWhitelistTest {

@TempDir private static Path folder;
@TempDir private Path folder;

protected static Vertx vertx;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@

public class GraphQLHttpServiceTest {

// this tempDir is deliberately static
@TempDir private static Path folder;

private static final Vertx vertx = Vertx.vertx();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.junit.jupiter.api.io.TempDir;

public class JsonRpcHttpServiceCorsTest {
@TempDir private static Path folder;
@TempDir private Path folder;

private final Vertx vertx = Vertx.vertx();
private final OkHttpClient client = new OkHttpClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
@ExtendWith(MockitoExtension.class)
public class JsonRpcHttpServiceLoginTest {

// this tempDir is deliberately static
@TempDir private static Path folder;

private static final Vertx vertx = Vertx.vertx();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
@ExtendWith(MockitoExtension.class)
public class JsonRpcHttpServiceRpcApisTest {

@TempDir private static Path folder;
@TempDir private Path folder;

private final Vertx vertx = Vertx.vertx();
private final OkHttpClient client = new OkHttpClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@

public class JsonRpcHttpServiceTestBase {

// this tempDir is deliberately static
@TempDir private static Path folder;
protected final JsonRpcTestHelper testHelper = new JsonRpcTestHelper();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
import org.junit.jupiter.api.io.TempDir;

public class JsonRpcHttpServiceTlsClientAuthTest {
// this tempDir is deliberately static
@TempDir private static Path folder;

protected static final Vertx vertx = Vertx.vertx();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

public class DebugStandardTraceBlockToFileTest {

// this tempDir is deliberately static
@TempDir private static Path folder;

private final WorldStateArchive archive =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
@MockitoSettings(strictness = Strictness.LENIENT)
public class TransactionTracerTest {

@TempDir private static Path traceDir;
@TempDir private Path traceDir;

@Mock private ProtocolSchedule protocolSchedule;
@Mock private Blockchain blockchain;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
@MockitoSettings(strictness = Strictness.LENIENT)
public class BlockchainQueriesLogCacheTest {

// this tempDir is deliberately static
@TempDir private static Path cacheDir;

private static LogsQuery logsQuery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

public class PrivacyPrecompiledContractIntegrationTest {

// this tempDir is deliberately static
@TempDir private static Path folder;

private static final Bytes VALID_PRIVATE_TRANSACTION_RLP =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

public class RawBlockIteratorTest {

@TempDir private static Path tmp;
@TempDir private Path tmp;
private BlockDataGenerator gen;

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class StaticNodesParserTest {
.discoveryAndListeningPorts(30306)
.build());

@TempDir private static Path testFolder;
@TempDir private Path testFolder;

@Test
public void validFileLoadsWithExpectedEnodes() throws IOException, URISyntaxException {
Expand Down

0 comments on commit a3ef0d8

Please sign in to comment.