@ExtendWith({ RepositoryManagementTestExecutionListener.class,

              ArtifactManagementTestExecutionListener.class })
@Test
void handlePartialDownloadWithMultipleRanges(@MavenRepository(repositoryId = REPOSITORY_RELEASES_4)
                                             Repository repository,
                                             @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_4,
                                                                id = "org.carlspring.strongbox:partial-multiple",
                                                                versions = "1.0")
                                             Path artifactPath)
        throws IOException
{
    // Given
    RepositoryPath artifactRepositoryPath = (RepositoryPath) artifactPath.normalize();
    try(InputStream is = artifactResolutionService.getInputStream(artifactRepositoryPath))
    {
        HttpHeaders httpHeaders = getHttpHeaders("0-500,510-519");
        HttpServletResponse response = new MockHttpServletResponse();
        response.setHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(Files.size(artifactRepositoryPath)));
        // When
        ArtifactControllerHelper.handlePartialDownload(is, httpHeaders, response);
        // Then
        assertThat(response.getStatus()).isEqualTo(HttpStatus.PARTIAL_CONTENT.value());
        assertThat(response.getContentType()).isEqualTo("multipart/byteranges; boundary=" + MULTIPART_BOUNDARY);
    }
}