Gradle Dependencies Check

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.036 seconds

TestSubject:

Issues:

See:

Features


should map a gradle configuration container preserving the order

Result: PASS Time: 0.033 seconds

def configurationA = Mock(Configuration)
def configurationB = Mock(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 io.github.gregoranders.gradle.dependencies.tooling.model.api.Configuration
set[0].name() == 'configurationAName'
set[0].dependencies().size() == 0
set[1] instanceof io.github.gregoranders.gradle.dependencies.tooling.model.api.Configuration
set[1].name() == 'configurationBName'
set[1].dependencies().size() == 0
noExceptionThrown()