use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependency in project kie-wb-common by kiegroup.
the class DependenciesItemPresenterTest method testRemove.
@Test
public void testRemove() {
final DependenciesPresenter parentPresenter = mock(DependenciesPresenter.class);
final EnhancedDependency enhancedDependency = new NormalEnhancedDependency(mock(Dependency.class), emptySet());
dependenciesItemPresenter.parentPresenter = parentPresenter;
dependenciesItemPresenter.enhancedDependency = enhancedDependency;
dependenciesItemPresenter.remove();
verify(parentPresenter).remove(eq(enhancedDependency));
}
use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependency in project kie-wb-common by kiegroup.
the class DependenciesItemPresenterTest method testRemoveAllPackagesToWhiteList.
@Test
public void testRemoveAllPackagesToWhiteList() {
final DependenciesPresenter parentPresenter = mock(DependenciesPresenter.class);
final Set<String> packages = new HashSet<>(Arrays.asList("foo", "bar"));
final EnhancedDependency enhancedDependency = new NormalEnhancedDependency(mock(Dependency.class), packages);
dependenciesItemPresenter.parentPresenter = parentPresenter;
dependenciesItemPresenter.enhancedDependency = enhancedDependency;
dependenciesItemPresenter.removeAllPackagesFromWhiteList();
verify(parentPresenter).removeAllFromWhiteList(eq(packages));
}
use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependency in project kie-wb-common by kiegroup.
the class DependenciesItemPresenter method setup.
public DependenciesItemPresenter setup(final EnhancedDependency enhancedDependency, final WhiteList whiteList, final DependenciesPresenter dependenciesPresenter) {
this.enhancedDependency = enhancedDependency;
this.parentPresenter = dependenciesPresenter;
final Dependency dependency = enhancedDependency.getDependency();
view.init(this);
view.setGroupId(dependency.getGroupId());
view.setArtifactId(dependency.getArtifactId());
view.setVersion(dependency.getVersion());
view.setPackagesWhiteListedState(WhiteListedPackagesState.from(whiteList, enhancedDependency.getPackages()));
view.setTransitiveDependency(enhancedDependency instanceof TransitiveEnhancedDependency);
return this;
}
use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependency in project kie-wb-common by kiegroup.
the class DependenciesItemPresenterTest method testAddAllPackagesToWhiteList.
@Test
public void testAddAllPackagesToWhiteList() {
final DependenciesPresenter parentPresenter = mock(DependenciesPresenter.class);
final Set<String> packages = new HashSet<>(Arrays.asList("foo", "bar"));
final EnhancedDependency enhancedDependency = new NormalEnhancedDependency(mock(Dependency.class), packages);
dependenciesItemPresenter.parentPresenter = parentPresenter;
dependenciesItemPresenter.enhancedDependency = enhancedDependency;
dependenciesItemPresenter.addAllPackagesToWhiteList();
verify(parentPresenter).addAllToWhiteList(eq(packages));
}
use of org.kie.workbench.common.services.shared.dependencies.EnhancedDependency in project kie-wb-common by kiegroup.
the class DependenciesPresenterTest method testRemove.
@Test
public void testRemove() {
final EnhancedDependency enhancedDependency = mock(EnhancedDependency.class);
dependenciesPresenter.remove(enhancedDependency);
verify(enhancedDependenciesManager).delete(eq(enhancedDependency));
}
Aggregations