}
@Test
public void testAddDependencyDescriptorForClientModule() {
final ModuleDependency dependencyDependency = context.mock(ModuleDependency.class, "dependencyDependency");
final DefaultClientModule clientModule = new DefaultClientModule("org.gradle", "gradle-core", "1.0", TEST_DEP_CONF);
final ModuleRevisionId testModuleRevisionId = IvyUtil.createModuleRevisionId(
clientModule, WrapUtil.toMap(ClientModule.CLIENT_MODULE_KEY, clientModule.getId()));
setUpDependency(clientModule);
clientModule.addDependency(dependencyDependency);
final ModuleDescriptor moduleDescriptorForClientModule = context.mock(ModuleDescriptor.class);
context.checking(new Expectations() {{
allowing(moduleDescriptorFactoryForClientModule).createModuleDescriptor(
testModuleRevisionId,
WrapUtil.toSet(dependencyDependency)
);
will(returnValue(moduleDescriptorForClientModule));
}});
clientModuleDependencyDescriptorFactory.addDependencyDescriptor(TEST_CONF, moduleDescriptor, clientModule);
assertThat((ModuleDescriptor) clientModuleRegistry.get(clientModule.getId()), equalTo(moduleDescriptorForClientModule));
DefaultDependencyDescriptor dependencyDescriptor = (DefaultDependencyDescriptor) moduleDescriptor.getDependencies()[0];
assertDependencyDescriptorHasCommonFixtureValues(dependencyDescriptor);
assertEquals(testModuleRevisionId,
dependencyDescriptor.getDependencyRevisionId());
assertFalse(dependencyDescriptor.isChanging());