diff --git a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java index 606b3dc676..a687a370b6 100644 --- a/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java +++ b/src/main/java/io/cryostat/recordings/RecordingArchiveHelper.java @@ -710,7 +710,7 @@ public Future> getRecordingsAndDirectories() { "beta/fs/recordings"), webServer .getArchivedReportURL( - subdirectoryName, file) + jvmId, file) .replace( "beta/reports", "beta/fs/reports"), diff --git a/src/test/java/itest/FileSystemArchivedRequestsIT.java b/src/test/java/itest/FileSystemArchivedRequestsIT.java index cfd01bbfc9..5ab606b09b 100644 --- a/src/test/java/itest/FileSystemArchivedRequestsIT.java +++ b/src/test/java/itest/FileSystemArchivedRequestsIT.java @@ -18,7 +18,6 @@ import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.Map; @@ -39,7 +38,6 @@ import io.vertx.core.json.JsonObject; import itest.bases.JwtAssetsSelfTest; import itest.util.Podman; -import org.apache.commons.codec.binary.Base32; import org.apache.http.client.utils.URIBuilder; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; @@ -48,7 +46,6 @@ public class FileSystemArchivedRequestsIT extends JwtAssetsSelfTest { private static final Gson gson = MainModule.provideGson(Logger.INSTANCE); - private static final Base32 base32 = new Base32(); static final String TEST_RECORDING_NAME = "FileSystemArchivedRequestsIT"; @@ -57,7 +54,7 @@ void testGetRecordingsAndDirectories() throws Exception { URL resource = null; URL archivedResource = null; Path assetDownload = null; - String subdirectoryName = null; + String jvmId = null; try { JsonObject creationResponse = createRecording(); resource = new URL(creationResponse.getString("downloadUrl")); @@ -97,8 +94,7 @@ void testGetRecordingsAndDirectories() throws Exception { MatcherAssert.assertThat(labels, Matchers.equalTo(expectedLabels)); // post metadata fromPath - subdirectoryName = - base32.encodeAsString(dir.getString("jvmId").getBytes(StandardCharsets.UTF_8)); + jvmId = dir.getString("jvmId"); String recordingName = archivedRecording.getString("name"); Map uploadMetadata = Map.of("label", "test"); CompletableFuture metadataFuture = new CompletableFuture<>(); @@ -106,7 +102,7 @@ void testGetRecordingsAndDirectories() throws Exception { .post( String.format( "/api/beta/fs/recordings/%s/%s/metadata/labels", - subdirectoryName, recordingName)) + jvmId, recordingName)) .sendBuffer( Buffer.buffer(gson.toJson(uploadMetadata, Map.class)), ar -> { @@ -183,7 +179,7 @@ void testGetRecordingsAndDirectories() throws Exception { .replaceFirst( "/api/v1/recordings", String.format( - "/api/beta/fs/recordings/%s", subdirectoryName)); + "/api/beta/fs/recordings/%s", jvmId)); cleanupCreatedResources(updatedArchivedPath); } if (assetDownload != null) {