@Test(expected = PluginException.class)
public void testInvalidPluginCacheDirectory() throws PluginException, IOException {

    Path cacheDirectory = getCacheDirectory();
    Path pluginCacheDirectory = getPluginCachePath();
    Files.createDirectories(cacheDirectory);
    Files.createFile(pluginCacheDirectory); //We create a file instead of directory
    Path pluginFile = getPluginFilePath();
    new DefaultClassesScanner(cacheDirectory).scan(pluginFile, new ArrayList<>());
}