As a user I would like to map a Gradle dependency to a model using a custom mapper.
Total Runs |
Success Rate |
Failures |
Errors |
Skipped |
Total time (ms) |
3 |
100.0% |
0 |
0 |
0 |
0.020 seconds |
TestSubject:
Issues:
See:
Features
should map a gradle dependency of { group: ‘dependencyGroup’ name: ‘dependencyName’ version: ‘dependencyVersion’ } to { group: ‘dependencyGroup’ name: ‘dependencyName’ version: ‘dependencyVersion’ }
Result: PASS
Time: 0.007 seconds
- Given a mocked gradle dependency
def mock = Mock(Dependency)
- When the unit under test maps this dependency
def model = testSubject.map(mock)
- Then following interactions should be executed
interaction {
1 * mock.getGroup() >> group
1 * mock.getName() >> name
1 * mock.getVersion() >> version
}
- And the returned model should be of the expected type
model instanceof io.github.gregoranders.gradle.dependencies.tooling.model.api.Dependency
- And have the expected values
verifyDependency(model, expectedGroup, expectedName, expectedVersion)
- And no exceptions should be thrown
group | name | version || expectedGroup | expectedName | expectedVersion
'dependencyGroup' | 'dependencyName' | 'dependencyVersion' || 'dependencyGroup' | 'dependencyName' | 'dependencyVersion'
null | 'dependencyName' | 'dependencyVersion' || '' | 'dependencyName' | 'dependencyVersion'
'dependencyGroup' | 'dependencyName' | null || 'dependencyGroup' | 'dependencyName' | ''
group |
name |
version |
expectedGroup |
expectedName |
expectedVersion |
|
|
dependencyGroup |
dependencyName |
dependencyVersion |
dependencyGroup |
dependencyName |
dependencyVersion |
0.007 seconds |
(PASS) |
should map a gradle dependency of { group: ‘null’ name: ‘dependencyName’ version: ‘dependencyVersion’ } to { group: ‘’ name: ‘dependencyName’ version: ‘dependencyVersion’ }
Result: PASS
Time: 0
- Given a mocked gradle dependency
def mock = Mock(Dependency)
- When the unit under test maps this dependency
def model = testSubject.map(mock)
- Then following interactions should be executed
interaction {
1 * mock.getGroup() >> group
1 * mock.getName() >> name
1 * mock.getVersion() >> version
}
- And the returned model should be of the expected type
model instanceof io.github.gregoranders.gradle.dependencies.tooling.model.api.Dependency
- And have the expected values
verifyDependency(model, expectedGroup, expectedName, expectedVersion)
- And no exceptions should be thrown
group | name | version || expectedGroup | expectedName | expectedVersion
'dependencyGroup' | 'dependencyName' | 'dependencyVersion' || 'dependencyGroup' | 'dependencyName' | 'dependencyVersion'
null | 'dependencyName' | 'dependencyVersion' || '' | 'dependencyName' | 'dependencyVersion'
'dependencyGroup' | 'dependencyName' | null || 'dependencyGroup' | 'dependencyName' | ''
group |
name |
version |
expectedGroup |
expectedName |
expectedVersion |
|
|
null |
dependencyName |
dependencyVersion |
|
dependencyName |
dependencyVersion |
0 |
(PASS) |
should map a gradle dependency of { group: ‘dependencyGroup’ name: ‘dependencyName’ version: ‘null’ } to { group: ‘dependencyGroup’ name: ‘dependencyName’ version: ‘’ }
Result: PASS
Time: 0
- Given a mocked gradle dependency
def mock = Mock(Dependency)
- When the unit under test maps this dependency
def model = testSubject.map(mock)
- Then following interactions should be executed
interaction {
1 * mock.getGroup() >> group
1 * mock.getName() >> name
1 * mock.getVersion() >> version
}
- And the returned model should be of the expected type
model instanceof io.github.gregoranders.gradle.dependencies.tooling.model.api.Dependency
- And have the expected values
verifyDependency(model, expectedGroup, expectedName, expectedVersion)
- And no exceptions should be thrown
group | name | version || expectedGroup | expectedName | expectedVersion
'dependencyGroup' | 'dependencyName' | 'dependencyVersion' || 'dependencyGroup' | 'dependencyName' | 'dependencyVersion'
null | 'dependencyName' | 'dependencyVersion' || '' | 'dependencyName' | 'dependencyVersion'
'dependencyGroup' | 'dependencyName' | null || 'dependencyGroup' | 'dependencyName' | ''
group |
name |
version |
expectedGroup |
expectedName |
expectedVersion |
|
|
dependencyGroup |
dependencyName |
null |
dependencyGroup |
dependencyName |
|
0 |
(PASS) |