@ExtendWith({ RepositoryManagementTestExecutionListener.class,

              ArtifactManagementTestExecutionListener.class })
@Test
void shouldNotHandlePartialDownloadWithSingleRangeWhenRequestedRangeNotSatisfiable(
        @MavenRepository(repositoryId = REPOSITORY_RELEASES_2)
        Repository repository,
        @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_2,
                           id = "org.carlspring.strongbox:partial-single-not-satisfiable",
                           versions = "1.0")
        Path artifactPath)
        throws IOException
{
    // Given
    RepositoryPath artifactRepositoryPath = (RepositoryPath) artifactPath.normalize();
    try(InputStream is = artifactResolutionService.getInputStream(artifactRepositoryPath))
    {
        long expectedLength = Files.size(artifactRepositoryPath);
        String byteRanges = String.format("%s-%s", expectedLength, expectedLength + 1);
        HttpHeaders httpHeaders = getHttpHeaders(byteRanges);
        HttpServletResponse response = new MockHttpServletResponse();
        // When
        ArtifactControllerHelper.handlePartialDownload(is, httpHeaders, response);
        // Then
        assertThat(response.getStatus()).isEqualTo(HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE.value());
        assertThat(response.getHeader(HttpHeaders.CONTENT_RANGE)).isEqualTo("bytes */" + expectedLength);
    }
}