@Test
public void testConflictingDependencyPresent() {

    PluginsAware pluginRegistry = mock(PluginsAware.class);
    doReturn(getPluginIdentityMetadata(FIXED_VERSION_NAME))
            .when(pluginRegistry).getPlugin(eq(FIXED_VERSION_NAME));
    doReturn(getPluginIdentityMetadata(VERSION_RANGE_NAME))
            .when(pluginRegistry).getPlugin(eq(VERSION_RANGE_NAME));
    List<Dependency> conflictingDependencies = new ArrayList<>();
    try {
        new DefaultDependencyChecker().check(pluginRegistry, getPluginDependenciesMetadata(new Dependency[0], new Dependency[]{
                DEPENDENCY_WITH_FIXED_VERSION, DEPENDENCY_WITH_VERSION_RANGE
        }));
    } catch (PluginException e) {
        assertTrue(e.getDependencyProblem().isPresent());
        conflictingDependencies.addAll(e.getDependencyProblem().get().getConflictingDependencies());
    }
    assertThat(conflictingDependencies, hasSize(1));
    assertThat(conflictingDependencies, contains(DEPENDENCY_WITH_VERSION_RANGE));
}