As a user I would like to map a Gradle configuration to a 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:
- io.github.gregoranders.gradle.dependencies.tooling.model.mapper.ConfigurationMapper
- io.github.gregoranders.gradle.dependencies.tooling.model.api.Configuration
Issues:
See:
- https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html
- io.github.gregoranders.gradle.dependencies.tooling.model.api.Configuration
- io.github.gregoranders.gradle.dependencies.tooling.model.mapper.ConfigurationMapper
Features
should map a gradle configuration
Result: PASS Time: 0.006 seconds
- Given a mocked gradle configuration
def mock = Mock(Configuration)
- And a mocked empty gradle dependency set
def mockedDependencySet = Mock(DependencySet)
- When the unit under test maps this configuration
def model = testSubject.map(mock)
- Then following interactions should be executed
interaction {
1 * mock.getName() >> 'configurationName'
1 * mock.getDependencies() >> mockedDependencySet
1 * mockedDependencySet.stream() >> Stream.empty()
}
- And the returned model should be of the expected type
model instanceof io.github.gregoranders.gradle.dependencies.tooling.model.api.Configuration
- And have the expected name
model.name() == 'configurationName'
- And no exceptions should be thrown
noExceptionThrown()