Search in sources :

Example 1 with ComponentSelectionWithCurrent

use of com.github.benmanes.gradle.versions.updates.resolutionstrategy.ComponentSelectionWithCurrent in project spring-security by spring-projects.

the class DependencyExcludesTests method currentVersionAndCandidateVersion.

private ComponentSelectionWithCurrent currentVersionAndCandidateVersion(ComponentSelection componentSelection, String currentVersion, String candidateVersion) {
    ModuleComponentIdentifier candidate = mock(ModuleComponentIdentifier.class);
    given(componentSelection.getCandidate()).willReturn(candidate);
    ComponentSelectionWithCurrent selection = new ComponentSelectionWithCurrent(currentVersion, componentSelection);
    given(candidate.getVersion()).willReturn(candidateVersion);
    given(componentSelection.getCandidate()).willReturn(candidate);
    return selection;
}
Also used : ComponentSelectionWithCurrent(com.github.benmanes.gradle.versions.updates.resolutionstrategy.ComponentSelectionWithCurrent) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier)

Example 2 with ComponentSelectionWithCurrent

use of com.github.benmanes.gradle.versions.updates.resolutionstrategy.ComponentSelectionWithCurrent in project spring-security by spring-projects.

the class DependencyExcludesTests method executeCreateExcludeMinorVersionBump.

private ComponentSelection executeCreateExcludeMinorVersionBump(String currentVersion, String candidateVersion) {
    ComponentSelection componentSelection = mock(ComponentSelection.class);
    UpdateDependenciesExtension.DependencyExcludes excludes = new UpdateDependenciesExtension(() -> Collections.emptyList()).new DependencyExcludes();
    Action<ComponentSelectionWithCurrent> excludeMinorVersionBump = excludes.createExcludeMinorVersionBump();
    ComponentSelectionWithCurrent selection = currentVersionAndCandidateVersion(componentSelection, currentVersion, candidateVersion);
    excludeMinorVersionBump.execute(selection);
    return componentSelection;
}
Also used : ComponentSelectionWithCurrent(com.github.benmanes.gradle.versions.updates.resolutionstrategy.ComponentSelectionWithCurrent) ComponentSelection(org.gradle.api.artifacts.ComponentSelection)

Aggregations

ComponentSelectionWithCurrent (com.github.benmanes.gradle.versions.updates.resolutionstrategy.ComponentSelectionWithCurrent)2 ComponentSelection (org.gradle.api.artifacts.ComponentSelection)1 ModuleComponentIdentifier (org.gradle.api.artifacts.component.ModuleComponentIdentifier)1