JetBrains IntelliJ Gradle Dependencies Plugin

Specification run results

View on GitHub

Dependencies model builder

As a user I would like to be able to get a custom model from a Gradle build to collect dependencies.

Total Runs Success Rate Failures Errors Skipped Total time (ms)
4 100.0% 0 0 0 0.245 seconds

TestSubject:

Issues:

See:

Features


should return true when invoked with io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.api.Project as the modelName

Result: PASS Time: 0

testSubject.canBuild(modelName) == expectedResult
modelName expectedResult    
io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.api.Project true 0 (PASS)

should return false when invoked with io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.api.Configuration as the modelName

Result: PASS Time: 0

testSubject.canBuild(modelName) == expectedResult
modelName expectedResult    
io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.api.Configuration false 0 (PASS)

should return false when invoked with io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.api.Dependency as the modelName

Result: PASS Time: 0

testSubject.canBuild(modelName) == expectedResult
modelName expectedResult    
io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.api.Dependency false 0 (PASS)

should return project model

Result: PASS Time: 0.146 seconds

Project mockedProject = Mock()
ConfigurationContainer mockedConfigurationsContainer = Mock()
Configuration mockedConfiguration = Mock()
DependencySet mockedDependencySet = Mock()
Dependency mockedDependency = Mock()
def project = (testSubject.buildAll('test', mockedProject) as io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.api.Project)
interaction {
    1 * mockedDependency.getGroup() >> 'testDependencyGroup'
    1 * mockedDependency.getName() >> 'testDependencyName'
    1 * mockedDependency.getVersion() >> 'testDependencyVersion'
    1 * mockedDependencySet.stream() >> Stream.of(mockedDependency)
    1 * mockedConfiguration.getDependencies() >> mockedDependencySet
    1 * mockedConfiguration.getName() >> 'testConfigurationName'
    1 * mockedConfigurationsContainer.stream() >> Stream.of(mockedConfiguration)
    1 * mockedProject.getConfigurations() >> mockedConfigurationsContainer
    1 * mockedProject.getGroup() >> 'testProjectGroup'
    1 * mockedProject.getName() >> 'testProjectName'
    1 * mockedProject.getDescription() >> 'testProjectDescription'
    1 * mockedProject.getVersion() >> 'testProjectVersion'
    1 * mockedProject.getPath() >> 'testProjectPath'
    1 * mockedProject.getSubprojects() >> Set.of()
}
project instanceof io.github.gregoranders.idea.gradle.dependencies.gradle.tooling.model.api.Project
project.group() == 'testProjectGroup'
project.name() == 'testProjectName'
project.description() == 'testProjectDescription'
project.version() == 'testProjectVersion'
project.path() == 'testProjectPath'
project.configurations().size() == 1
project.configurations()[0].name() == 'testConfigurationName'
project.configurations()[0].dependencies().size() == 1
project.configurations()[0].dependencies()[0].name() == 'testDependencyName'
project.configurations()[0].dependencies()[0].group() == 'testDependencyGroup'
project.configurations()[0].dependencies()[0].version() == 'testDependencyVersion'
noExceptionThrown()