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.020 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.005 seconds
- Given a mocked gradle project
def mock = Mock(org.gradle.api.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
- 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 |
0.005 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.003 seconds
- Given a mocked gradle project
def mock = Mock(org.gradle.api.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
- 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 |
null |
projectVersion |
projectPath |
projectGroup |
projectName |
|
projectVersion |
projectPath |
0.003 seconds |
(PASS) |