JetBrains IntelliJ Gradle Dependencies Plugin

Specification run results

View on GitHub

As a user I would like to map a Gradle ConfigurationContainer to a set of model using a custom mapper.

Total Runs Success Rate Failures Errors Skipped Total time (ms)
1 100.0% 0 0 0 0.011 seconds

TestSubject:

Issues:

See:

Features


should map a gradle configuration container preserving the order

Result: PASS Time: 0.008 seconds

def configurationA = Mock(org.gradle.api.artifacts.Configuration)
def configurationB = Mock(org.gradle.api.artifacts.Configuration)
def configurationContainer = Mock(ConfigurationContainer)
def set = testSubject.map(configurationContainer)
interaction {
                1 * configurationContainer.stream() >> Stream.of(configurationA, configurationB)

                1 * configurationA.getName() >> 'configurationAName'
                1 * configurationA.getDependencies() >> {
                    def dependencySet = Mock(DependencySet)
                    1 * dependencySet.stream() >> Stream.empty()
                    dependencySet
                }
                1 * configurationB.getName() >> 'configurationBName'
                1 * configurationB.getDependencies() >> {
                    def dependencySet = Mock(DependencySet)
                    1 * dependencySet.stream() >> Stream.empty()
                    dependencySet
                }
            }
set.size() == 2
set[0] instanceof Configuration
set[0].name() == 'configurationAName'
set[0].dependencies().size() == 0
set[1] instanceof Configuration
set[1].name() == 'configurationBName'
set[1].dependencies().size() == 0
noExceptionThrown()