@Test
public void testDeleteAllBundleVersions() throws IOException {

    final String bucketId = "b1";
    final String groupId = "g1";
    final String artifactId = "a1";
    final String version1 = "1.0.0";
    final String version2 = "2.0.0";
    final BundleVersionType bundleType = BundleVersionType.NIFI_NAR;
    // create and verify the bundle version 1
    final String content1 = groupId + "-" + artifactId + "-" + version1;
    final BundleVersionCoordinate versionCoordinate1 = getVersionCoordinate(bucketId, groupId, artifactId, version1, bundleType);
    createBundleVersion(fileSystemBundleProvider, versionCoordinate1, content1);
    verifyBundleVersion(bundleStorageDir, versionCoordinate1, content1);
    // create and verify the bundle version 2
    final String content2 = groupId + "-" + artifactId + "-" + version2;
    final BundleVersionCoordinate versionCoordinate2 = getVersionCoordinate(bucketId, groupId, artifactId, version2, bundleType);
    createBundleVersion(fileSystemBundleProvider, versionCoordinate2, content2);
    verifyBundleVersion(bundleStorageDir, versionCoordinate2, content2);
    Assert.assertEquals(1, bundleStorageDir.listFiles().length);
    final BundleCoordinate bundleCoordinate = getBundleCoordinate(bucketId, groupId, artifactId);
    fileSystemBundleProvider.deleteAllBundleVersions(bundleCoordinate);
    Assert.assertEquals(0, bundleStorageDir.listFiles().length);
}