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.028 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.004 seconds
- Given a mocked gradle dependency
def mock = Mock(org.gradle.api.artifacts.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 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 |
0.004 seconds |
(PASS) |
should map a gradle dependency of { group: ‘null’ name: ‘dependencyName’ version: ‘dependencyVersion’ } to { group: ‘’ name: ‘dependencyName’ version: ‘dependencyVersion’ }
Result: PASS
Time: 0.002 seconds
- Given a mocked gradle dependency
def mock = Mock(org.gradle.api.artifacts.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 Dependency
- And have the expected values
verifyDependency(model, expectedGroup, expectedName, expectedVersion)
- And no exceptions should be thrown
group |
name |
version |
expectedGroup |
expectedName |
expectedVersion |
|
|
null |
dependencyName |
dependencyVersion |
|
dependencyName |
dependencyVersion |
0.002 seconds |
(PASS) |
should map a gradle dependency of { group: ‘dependencyGroup’ name: ‘dependencyName’ version: ‘null’ } to { group: ‘dependencyGroup’ name: ‘dependencyName’ version: ‘’ }
Result: PASS
Time: 0.001 seconds
- Given a mocked gradle dependency
def mock = Mock(org.gradle.api.artifacts.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 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 |
null |
dependencyGroup |
dependencyName |
|
0.001 seconds |
(PASS) |