public void convert() {
final Set<Configuration> configurationsDummy = WrapUtil.toSet(context.mock(Configuration.class, "conf1"),
context.mock(Configuration.class, "conf2"));
final Module moduleDummy = context.mock(Module.class);
final IvySettings ivySettingsDummy = new IvySettings();
final DefaultModuleDescriptor moduleDescriptorDummy = context.mock(DefaultModuleDescriptor.class);
final ModuleDescriptorFactory moduleDescriptorFactoryStub = context.mock(ModuleDescriptorFactory.class);
final ConfigurationsToModuleDescriptorConverter configurationsToModuleDescriptorConverterMock = context.mock(ConfigurationsToModuleDescriptorConverter.class);
final DependenciesToModuleDescriptorConverter dependenciesToModuleDescriptorConverterMock = context.mock(DependenciesToModuleDescriptorConverter.class);
ResolveModuleDescriptorConverter resolveModuleDescriptorConverter = new ResolveModuleDescriptorConverter(
moduleDescriptorFactoryStub,
configurationsToModuleDescriptorConverterMock,
dependenciesToModuleDescriptorConverterMock);
context.checking(new Expectations() {{
allowing(moduleDescriptorFactoryStub).createModuleDescriptor(moduleDummy);
will(returnValue(moduleDescriptorDummy));
one(configurationsToModuleDescriptorConverterMock).addConfigurations(moduleDescriptorDummy, configurationsDummy);
one(dependenciesToModuleDescriptorConverterMock).addDependencyDescriptors(moduleDescriptorDummy, configurationsDummy, ivySettingsDummy);
}});
DefaultModuleDescriptor actualModuleDescriptor = (DefaultModuleDescriptor)
resolveModuleDescriptorConverter.convert(configurationsDummy, moduleDummy, ivySettingsDummy);
assertThat(actualModuleDescriptor, equalTo(moduleDescriptorDummy));
}