Skip to content

Commit

Permalink
Replaced deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
SethSmucker committed Sep 30, 2024
1 parent aa90b87 commit 2f676e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public AuditReplayRemoteRequestEvent(Object source, String originService, Reques
}

public AuditReplayRemoteRequestEvent(Object source, String originService, String destinationService, Request request) {
super(source, originService, destinationService);
super(source, originService, DEFAULT_DESTINATION_FACTORY.getDestination(destinationService));
this.request = request;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.attribute.FileAttribute;
import java.nio.file.attribute.PosixFilePermission;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand All @@ -21,6 +23,7 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -625,7 +628,12 @@ public HealthChecker healthChecker() {
public FileAuditProperties fileAuditProperties() {
FileAuditProperties fileAuditProperties = new FileAuditProperties();
@SuppressWarnings("UnstableApiUsage")
File tempDir = Files.createTempDir();
File tempDir;
try {
tempDir = java.nio.file.Files.createTempDirectory("tempDir").toFile();
} catch (IOException e) {
throw new RuntimeException("Failed to create temporary directory", e);
}
tempDir.deleteOnExit();
fileAuditProperties.setPathUri(tempDir.toURI().toString());
fileAuditProperties.setSubPath("audit");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -127,7 +128,7 @@ public void setup() throws Exception {

// Copy replay files before each test
File dataDir = new File("src/test/resources/data");
for (File file : dataDir.listFiles())
for (File file : Objects.requireNonNull(dataDir.listFiles()))
FileUtils.copyFileToDirectory(file, tempDir);

isHealthy = true;
Expand Down

0 comments on commit 2f676e0

Please sign in to comment.