From 450bfda31ebe1de01befa9fbeeb0f89a4e5f281f Mon Sep 17 00:00:00 2001 From: Sebastian Firsching Date: Wed, 21 Jun 2023 16:20:34 +0200 Subject: [PATCH] Adapt rest docs tests Signed-off-by: Sebastian Firsching --- .../mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java | 4 ---- .../hawkbit/rest/documentation/MgmtApiModelProperties.java | 2 +- .../documentation/SoftwaremodulesDocumentationTest.java | 6 +++--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java b/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java index 67889db61..33b44a87c 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java +++ b/hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java @@ -604,10 +604,6 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes final Artifact artifact = artifactManagement.create( new ArtifactUpload(new ByteArrayInputStream(random), sm.getId(), "file1", false, artifactSize)); - final MvcResult result = mvc.perform(get("/rest/v1/softwaremodules/{smId}/artifacts/{artId}?downloadurltype=cdn", sm.getId(), artifact.getId()).accept( - MediaType.APPLICATION_JSON)) - .andDo(MockMvcResultPrinter.print()).andReturn(); - // perform test mvc.perform(get("/rest/v1/softwaremodules/{smId}/artifacts/{artId}?useartifacturlhandler=true", sm.getId(), artifact.getId()).accept( MediaType.APPLICATION_JSON)) diff --git a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/documentation/MgmtApiModelProperties.java b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/documentation/MgmtApiModelProperties.java index a85c2d77b..0ba4bf4e4 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/documentation/MgmtApiModelProperties.java +++ b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/documentation/MgmtApiModelProperties.java @@ -57,7 +57,7 @@ public final class MgmtApiModelProperties { public static final String ARTIFACT_HASHES_SHA256 = "SHA256 hash of the artifact."; public static final String ARTIFACT_DOWNLOAD_LINK = "Download link of the artifact based on the chosen download url type parameter."; public static final String ARTIFACT_LIST = "List of artifacts of given software module."; - public static final String ARTIFACT_DOWNLOAD_URL_TYPE = "Type of the artifact download url. (can be default or cdn)"; + public static final String ARTIFACT_DOWNLOAD_USE_URL_HANDLER = "Indicates if the artifact URL handler should be used e.g. for external links."; // Distribution Set public static final String DS_OS = "Operating system or firmware software module - DEPRECATED (use modules)."; diff --git a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/SoftwaremodulesDocumentationTest.java b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/SoftwaremodulesDocumentationTest.java index a579cd577..09d6f4f67 100644 --- a/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/SoftwaremodulesDocumentationTest.java +++ b/hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/SoftwaremodulesDocumentationTest.java @@ -368,7 +368,7 @@ public class SoftwaremodulesDocumentationTest extends AbstractApiRestDocumentati mockMvc.perform( get(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts/{artifactId}", - sm.getId(), artifact.getId()).param("downloadurltype", "default")) + sm.getId(), artifact.getId())) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(content().contentType(MediaTypes.HAL_JSON)) .andDo(this.document.document( @@ -404,12 +404,12 @@ public class SoftwaremodulesDocumentationTest extends AbstractApiRestDocumentati mockMvc.perform( get(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts/{artifactId}", - sm.getId(), artifact.getId()).param("downloadurltype", "default")) + sm.getId(), artifact.getId()).param("useartifacturlhandler", "true")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(content().contentType(MediaTypes.HAL_JSON)) .andDo(this.document.document( requestParameters( - parameterWithName("downloadurltype").description(MgmtApiModelProperties.ARTIFACT_DOWNLOAD_URL_TYPE)))); + parameterWithName("useartifacturlhandler").description(MgmtApiModelProperties.ARTIFACT_DOWNLOAD_USE_URL_HANDLER)))); } @Test