As a user I would like to map a Gradle project to a model using a custom mapper.
Total Runs |
Success Rate |
Failures |
Errors |
Skipped |
Total time (ms) |
2 |
100.0% |
0 |
0 |
0 |
0.018 seconds |
TestSubject:
Issues:
See:
Features
should map a gradle project of { group: ‘projectGroup’ name: ‘projectName’ description: projectDescription version: ‘projectVersion’ path: projectPath } to { group: ‘projectGroup’ name: ‘projectName’ description: ‘projectDescription’ version: ‘projectVersion’ path ‘projectPath’}
Result: PASS
Time: 0.007 seconds
- Given a mocked gradle project
- When the unit under test maps this project
def model = testSubject.map(mock)
- Then following interactions should be executed
interaction {
1 * mock.getGroup() >> group
1 * mock.getName() >> name
1 * mock.getDescription() >> description
1 * mock.getVersion() >> version
1 * mock.getPath() >> path
1 * mock.getConfigurations() >> {
def mockedContainerConfiguration = Mock(ConfigurationContainer)
1 * mockedContainerConfiguration.stream() >> Stream.empty()
mockedContainerConfiguration
}
1 * mock.getSubprojects() >> Set.of()
}
- And the returned model should be of the expected type
model instanceof io.github.gregoranders.gradle.dependencies.tooling.model.api.Project
- And have the expected values
verifyProject(model, expectedGroup, expectedName, expectedDescription, expectedVersion, expectedPath)
- And no exceptions should be thrown
group | name | description | version | path || expectedGroup | expectedName | expectedDescription | expectedVersion | expectedPath
'projectGroup' | 'projectName' | 'projectDescription' | 'projectVersion' | 'projectPath' || 'projectGroup' | 'projectName' | 'projectDescription' | 'projectVersion' | 'projectPath'
'projectGroup' | 'projectName' | null | 'projectVersion' | 'projectPath' || 'projectGroup' | 'projectName' | '' | 'projectVersion' | 'projectPath'
group |
name |
description |
version |
path |
expectedGroup |
expectedName |
expectedDescription |
expectedVersion |
expectedPath |
|
|
projectGroup |
projectName |
projectDescription |
projectVersion |
projectPath |
projectGroup |
projectName |
projectDescription |
projectVersion |
projectPath |
0.007 seconds |
(PASS) |
should map a gradle project of { group: ‘projectGroup’ name: ‘projectName’ description: null version: ‘projectVersion’ path: projectPath } to { group: ‘projectGroup’ name: ‘projectName’ description: ‘’ version: ‘projectVersion’ path ‘projectPath’}
Result: PASS
Time: 0.001 seconds
- Given a mocked gradle project
- When the unit under test maps this project
def model = testSubject.map(mock)
- Then following interactions should be executed
interaction {
1 * mock.getGroup() >> group
1 * mock.getName() >> name
1 * mock.getDescription() >> description
1 * mock.getVersion() >> version
1 * mock.getPath() >> path
1 * mock.getConfigurations() >> {
def mockedContainerConfiguration = Mock(ConfigurationContainer)
1 * mockedContainerConfiguration.stream() >> Stream.empty()
mockedContainerConfiguration
}
1 * mock.getSubprojects() >> Set.of()
}
- And the returned model should be of the expected type
model instanceof io.github.gregoranders.gradle.dependencies.tooling.model.api.Project
- And have the expected values
verifyProject(model, expectedGroup, expectedName, expectedDescription, expectedVersion, expectedPath)
- And no exceptions should be thrown
group | name | description | version | path || expectedGroup | expectedName | expectedDescription | expectedVersion | expectedPath
'projectGroup' | 'projectName' | 'projectDescription' | 'projectVersion' | 'projectPath' || 'projectGroup' | 'projectName' | 'projectDescription' | 'projectVersion' | 'projectPath'
'projectGroup' | 'projectName' | null | 'projectVersion' | 'projectPath' || 'projectGroup' | 'projectName' | '' | 'projectVersion' | 'projectPath'
group |
name |
description |
version |
path |
expectedGroup |
expectedName |
expectedDescription |
expectedVersion |
expectedPath |
|
|
projectGroup |
projectName |
null |
projectVersion |
projectPath |
projectGroup |
projectName |
|
projectVersion |
projectPath |
0.001 seconds |
(PASS) |