JetBrains IntelliJ Gradle Dependencies Plugin

Specification run results

View on GitHub

As a user I would like to map a Gradle DependencySet 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.005 seconds

TestSubject:

Issues:

See:

Features


should map a gradle dependency set preserving the order

Result: PASS Time: 0.002 seconds

def dependencyA = Mock(org.gradle.api.artifacts.Dependency)
def dependencyB = Mock(org.gradle.api.artifacts.Dependency)
def dependencySet = Mock(DependencySet)
def set = testSubject.map(dependencySet)
interaction {
                1 * dependencySet.stream() >> Stream.of(dependencyA, dependencyB)

                1 * dependencyA.getGroup() >> 'dependencyAGroup'
                1 * dependencyA.getName() >> 'dependencyAName'
                1 * dependencyA.getVersion() >> 'dependencyAVersion'

                1 * dependencyB.getGroup() >> 'dependencyBGroup'
                1 * dependencyB.getName() >> 'dependencyBName'
                1 * dependencyB.getVersion() >> 'dependencyBVersion'
            }
set.size() == 2
set[0] instanceof Dependency
verifyDependency(set[0], 'dependencyAGroup', 'dependencyAName', 'dependencyAVersion')
set[1] instanceof Dependency
verifyDependency(set[1], 'dependencyBGroup', 'dependencyBName', 'dependencyBVersion')
noExceptionThrown()