Adapt rest docs tests
Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>
This commit is contained in:
@@ -604,10 +604,6 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes
|
|||||||
final Artifact artifact = artifactManagement.create(
|
final Artifact artifact = artifactManagement.create(
|
||||||
new ArtifactUpload(new ByteArrayInputStream(random), sm.getId(), "file1", false, artifactSize));
|
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
|
// perform test
|
||||||
mvc.perform(get("/rest/v1/softwaremodules/{smId}/artifacts/{artId}?useartifacturlhandler=true", sm.getId(), artifact.getId()).accept(
|
mvc.perform(get("/rest/v1/softwaremodules/{smId}/artifacts/{artId}?useartifacturlhandler=true", sm.getId(), artifact.getId()).accept(
|
||||||
MediaType.APPLICATION_JSON))
|
MediaType.APPLICATION_JSON))
|
||||||
|
|||||||
@@ -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_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_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_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
|
// Distribution Set
|
||||||
public static final String DS_OS = "Operating system or firmware software module - DEPRECATED (use modules).";
|
public static final String DS_OS = "Operating system or firmware software module - DEPRECATED (use modules).";
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ public class SoftwaremodulesDocumentationTest extends AbstractApiRestDocumentati
|
|||||||
|
|
||||||
mockMvc.perform(
|
mockMvc.perform(
|
||||||
get(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts/{artifactId}",
|
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())
|
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
|
||||||
.andExpect(content().contentType(MediaTypes.HAL_JSON))
|
.andExpect(content().contentType(MediaTypes.HAL_JSON))
|
||||||
.andDo(this.document.document(
|
.andDo(this.document.document(
|
||||||
@@ -404,12 +404,12 @@ public class SoftwaremodulesDocumentationTest extends AbstractApiRestDocumentati
|
|||||||
|
|
||||||
mockMvc.perform(
|
mockMvc.perform(
|
||||||
get(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING + "/{softwareModuleId}/artifacts/{artifactId}",
|
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())
|
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
|
||||||
.andExpect(content().contentType(MediaTypes.HAL_JSON))
|
.andExpect(content().contentType(MediaTypes.HAL_JSON))
|
||||||
.andDo(this.document.document(
|
.andDo(this.document.document(
|
||||||
requestParameters(
|
requestParameters(
|
||||||
parameterWithName("downloadurltype").description(MgmtApiModelProperties.ARTIFACT_DOWNLOAD_URL_TYPE))));
|
parameterWithName("useartifacturlhandler").description(MgmtApiModelProperties.ARTIFACT_DOWNLOAD_USE_URL_HANDLER))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user