use of org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency 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.NormalEnhancedDependency in project kie-wb-common by kiegroup.
the class EnhancedDependenciesManager method updateWithOriginalDependency.
private void updateWithOriginalDependency(final NormalEnhancedDependency enhancedDependency) {
final Dependency originalDependency = originalSetOfDependencies.get(enhancedDependency.getDependency());
enhancedDependency.setDependency(originalDependency);
}
use of org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency in project kie-wb-common by kiegroup.
the class EnhancedDependenciesManagerResetTest method init.
private Callback init(final POM pom) {
final Callback callback = mock(Callback.class);
manager.init(pom, callback);
final EnhancedDependencies enhancedDependencies = new EnhancedDependencies();
for (Dependency dependency : pom.getDependencies()) {
enhancedDependencies.add(new NormalEnhancedDependency(dependency, new HashSet<String>()));
}
manager.onEnhancedDependenciesUpdated(enhancedDependencies);
return callback;
}
use of org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency in project kie-wb-common by kiegroup.
the class EnhancedDependenciesManager_onEchancedDependenciesLoadedTest method testAdd.
@Test
public void testAdd() throws Exception {
final Dependency dependency = makeDependency("artifactId", "groupId", "1.0");
enhancedDependenciesManager.addNew(dependency);
final EnhancedDependencies loadedEnhancedDependencies = new EnhancedDependencies();
loadedEnhancedDependencies.add(new NormalEnhancedDependency(dependency, new HashSet<String>()));
enhancedDependenciesManager.onEnhancedDependenciesUpdated(loadedEnhancedDependencies);
assertEquals(3, originalSetOfDependencies.size());
assertTrue(originalSetOfDependencies.contains(dependency));
assertEquals(1, shownDependencies.size());
assertTrue(shownDependencies.asList().get(0).getDependency().isGAVEqual(dependency));
}
use of org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency in project kie-wb-common by kiegroup.
the class EnhancedDependenciesManager_onEchancedDependenciesLoadedTest method testDelete.
@Test
public void testDelete() throws Exception {
enhancedDependenciesManager.delete(new NormalEnhancedDependency(makeDependency("org.junit", "junit", "1.0"), new HashSet<String>()));
verify(dependencyLoader).load();
// Queue is empty so loader returns with nothing.
enhancedDependenciesManager.onEnhancedDependenciesUpdated(new EnhancedDependencies());
assertTrue(shownDependencies.isEmpty());
assertFalse(originalSetOfDependencies.contains(junit));
}
Aggregations