use of org.kie.workbench.common.services.shared.whitelist.WhiteList in project kie-wb-common by kiegroup.
the class PackageNameWhiteListServiceImplTest method ifWhiteListIsEmptyWhiteListEverything.
@Test
public void ifWhiteListIsEmptyWhiteListEverything() throws Exception {
final PackageNameWhiteListService packageNameWhiteListService = makeService("");
WhiteList filterPackageNames = packageNameWhiteListService.filterPackageNames(mock(KieModule.class), new ArrayList<String>() {
{
add("a");
add("b");
add("c");
}
});
assertEquals(3, filterPackageNames.size());
assertTrue(filterPackageNames.contains("a"));
assertTrue(filterPackageNames.contains("b"));
assertTrue(filterPackageNames.contains("c"));
}
use of org.kie.workbench.common.services.shared.whitelist.WhiteList in project kie-wb-common by kiegroup.
the class PackageNameWhiteListServiceImplTest method testSave.
@Test
public void testSave() throws Exception {
final PackageNameWhiteListService service = makeService("");
final Path path = mock(Path.class);
final WhiteList whiteList = new WhiteList();
final Metadata metadata = new Metadata();
final String comment = "comment";
service.save(path, whiteList, metadata, comment);
verify(saver).save(path, whiteList, metadata, comment);
}
use of org.kie.workbench.common.services.shared.whitelist.WhiteList in project kie-wb-common by kiegroup.
the class DependenciesItemPresenterTest method testSetupNormal.
@Test
public void testSetupNormal() {
dependenciesItemPresenter.setup(new NormalEnhancedDependency(mock(Dependency.class), emptySet()), new WhiteList(), mock(DependenciesPresenter.class));
verify(view).init(any());
verify(view).setGroupId(any());
verify(view).setArtifactId(any());
verify(view).setVersion(any());
verify(view).setPackagesWhiteListedState(any());
verify(view).setTransitiveDependency(eq(false));
}
use of org.kie.workbench.common.services.shared.whitelist.WhiteList in project kie-wb-common by kiegroup.
the class DependenciesItemPresenterTest method testSetupTransitive.
@Test
public void testSetupTransitive() {
dependenciesItemPresenter.setup(new TransitiveEnhancedDependency(mock(Dependency.class), emptySet()), new WhiteList(), mock(DependenciesPresenter.class));
verify(view).init(any());
verify(view).setGroupId(any());
verify(view).setArtifactId(any());
verify(view).setVersion(any());
verify(view).setPackagesWhiteListedState(any());
verify(view).setTransitiveDependency(eq(true));
}
use of org.kie.workbench.common.services.shared.whitelist.WhiteList in project kie-wb-common by kiegroup.
the class ProjectScreenModelLoaderTest method testWhiteListNoMetadata.
@Test
public void testWhiteListNoMetadata() throws Exception {
final WhiteList whiteList = new WhiteList();
testFileSystem.deleteFile(packageNamesWhiteListPath);
when(whiteListService.load(packageNamesWhiteListPath)).thenReturn(whiteList);
ProjectScreenModel model = loader.load(pathToPom);
assertEquals(packageNamesWhiteListPath, model.getPathToWhiteList());
assertEquals(whiteList, model.getWhiteList());
assertNotNull(model.getWhiteListMetaData());
}
Aggregations