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.005 seconds |
TestSubject:
- io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.mapper.ConfigurationMapper
- io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.api.Configuration
Issues:
See:
- https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html
- io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.api.Configuration
- io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.mapper.ConfigurationMapper
Features
should map a gradle configuration
Result: PASS Time: 0.003 seconds
- Given a mocked gradle configuration
def mock = Mock(org.gradle.api.artifacts.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 Configuration
- And have the expected name
model.name() == 'configurationName'
- And no exceptions should be thrown
noExceptionThrown()