DefaultDependenciesToModuleDescriptorConverter converter = new DefaultDependenciesToModuleDescriptorConverter(
dependencyDescriptorFactoryStub, excludeRuleConverterStub);
Configuration configurationStub1 = createNamedConfigurationStubWithDependenciesAndExcludeRules("conf1", GRADLE_EXCLUDE_RULE_DUMMY_1, dependencyDummy1, similarDependency1);
Configuration configurationStub2 = createNamedConfigurationStubWithDependenciesAndExcludeRules("conf2", GRADLE_EXCLUDE_RULE_DUMMY_2, dependencyDummy2, similarDependency2);
Configuration configurationStub3 = createNamedConfigurationStubWithDependenciesAndExcludeRules("conf3", null, similarDependency3);
DefaultModuleDescriptor moduleDescriptor = HelperUtil.createModuleDescriptor(toSet(configurationStub1.getName(),
configurationStub2.getName()));
associateDependencyWithDescriptor(dependencyDummy1, moduleDescriptor, configurationStub1);
associateDependencyWithDescriptor(dependencyDummy2, moduleDescriptor, configurationStub2);
associateDependencyWithDescriptor(similarDependency1, moduleDescriptor, configurationStub1);
associateDependencyWithDescriptor(similarDependency2, moduleDescriptor, configurationStub2);
associateDependencyWithDescriptor(similarDependency3, moduleDescriptor, configurationStub3);
associateGradleExcludeRuleWithIvyExcludeRule(GRADLE_EXCLUDE_RULE_DUMMY_1, ivyExcludeRuleStub1, configurationStub1);
associateGradleExcludeRuleWithIvyExcludeRule(GRADLE_EXCLUDE_RULE_DUMMY_2, ivyExcludeRuleStub2, configurationStub2);
converter.addDependencyDescriptors(moduleDescriptor, toSet(configurationStub1, configurationStub2, configurationStub3),
ivySettingsDummy);
assertThat(moduleDescriptor.getExcludeRules(toArray(configurationStub1.getName())), equalTo(toArray(
ivyExcludeRuleStub1)));
assertThat(moduleDescriptor.getExcludeRules(toArray(configurationStub2.getName())), equalTo(toArray(
ivyExcludeRuleStub2)));
assertIsCorrectConflictResolver(moduleDescriptor);
}