Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Oct 18, 2023
1 parent 9f58016 commit be4c6d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ public Future<List<ArchiveDirectory>> getRecordingsAndDirectories() {
"beta/fs/recordings"),
webServer
.getArchivedReportURL(
subdirectoryName, file)
jvmId, file)
.replace(
"beta/reports",
"beta/fs/reports"),
Expand Down
12 changes: 4 additions & 8 deletions src/test/java/itest/FileSystemArchivedRequestsIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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";

Expand All @@ -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"));
Expand Down Expand Up @@ -97,16 +94,15 @@ 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<String, String> uploadMetadata = Map.of("label", "test");
CompletableFuture<JsonObject> metadataFuture = new CompletableFuture<>();
webClient
.post(
String.format(
"/api/beta/fs/recordings/%s/%s/metadata/labels",
subdirectoryName, recordingName))
jvmId, recordingName))
.sendBuffer(
Buffer.buffer(gson.toJson(uploadMetadata, Map.class)),
ar -> {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit be4c6d8

Please sign in to comment.