@ExtendWith({ RepositoryManagementTestExecutionListener.class,

              ArtifactManagementTestExecutionListener.class })
@Test
public void testDeleteArtifactDirectory(@MavenRepository(repositoryId = REPOSITORY_RELEASES_1,
                                                         setup = MavenIndexedRepositorySetup.class)
                                        Repository repository,
                                        @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_1,
                                                           id = "com.artifacts.to.delete.releases:delete-foo",
                                                           versions = "1.2.2")
                                        Path artifactPath)
        throws Exception
{
    RepositoryPath artifactDirectoryPath = (RepositoryPath) artifactPath.getParent().normalize();
    String artifactDirectoryPathStr = RepositoryFiles.relativizePath(artifactDirectoryPath);
    assertThat(Files.exists(artifactDirectoryPath))
            .as("Failed to locate artifact directory '" + artifactDirectoryPath + "'!")
            .isTrue();
    client.delete(repository.getStorage().getId(),
                  repository.getId(),
                  artifactDirectoryPathStr);
    assertThat(Files.notExists(artifactDirectoryPath))
            .as("Failed to delete artifact file '" + artifactDirectoryPath + "'!")
            .isTrue();
}