From ade82a0df531007297bdd05f1528aa07b4213a22 Mon Sep 17 00:00:00 2001 From: Eric Wittmann Date: Tue, 14 May 2024 14:51:59 -0400 Subject: [PATCH] Fix a problem in the canonical hash integration test --- .../GenerateCanonicalHashImportIT.java | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/integration-tests/src/test/java/io/apicurio/tests/migration/GenerateCanonicalHashImportIT.java b/integration-tests/src/test/java/io/apicurio/tests/migration/GenerateCanonicalHashImportIT.java index 28b9b56863..9de347b5f1 100644 --- a/integration-tests/src/test/java/io/apicurio/tests/migration/GenerateCanonicalHashImportIT.java +++ b/integration-tests/src/test/java/io/apicurio/tests/migration/GenerateCanonicalHashImportIT.java @@ -1,28 +1,10 @@ package io.apicurio.tests.migration; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.zip.ZipOutputStream; - -import org.apache.commons.codec.digest.DigestUtils; -import org.junit.jupiter.api.Tag; -import org.junit.jupiter.api.Test; - import io.apicurio.registry.client.auth.VertXAuthFactory; import io.apicurio.registry.model.BranchId; import io.apicurio.registry.rest.client.RegistryClient; import io.apicurio.registry.types.ArtifactType; +import io.apicurio.registry.types.ContentTypes; import io.apicurio.registry.types.VersionState; import io.apicurio.registry.utils.IoUtil; import io.apicurio.registry.utils.impexp.ArtifactBranchEntity; @@ -34,6 +16,24 @@ import io.apicurio.tests.utils.Constants; import io.kiota.http.vertx.VertXRequestAdapter; import io.quarkus.test.junit.QuarkusIntegrationTest; +import org.apache.commons.codec.digest.DigestUtils; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.api.Test; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.zip.ZipOutputStream; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; @QuarkusIntegrationTest @Tag(Constants.MIGRATION) @@ -95,6 +95,7 @@ public InputStream generateExportedZip(Map artifacts) { Long contentId = contentIndex.computeIfAbsent(contentHash, k -> { ContentEntity contentEntity = new ContentEntity(); contentEntity.contentId = contentIdSeq.getAndIncrement(); + contentEntity.contentType = ContentTypes.APPLICATION_JSON; contentEntity.contentHash = contentHash; contentEntity.canonicalHash = null; contentEntity.contentBytes = contentBytes;