use of org.kie.workbench.common.services.shared.allowlist.AllowList in project kie-wb-common by kiegroup.
the class ProjectScreenModelSaverTest method testAllowListSave.
@Test
public void testAllowListSave() throws Exception {
final ProjectScreenModel model = new ProjectScreenModel();
final AllowList allowList = new AllowList();
model.setAllowList(allowList);
final Path pathToAllowList = mock(Path.class);
model.setPathToAllowList(pathToAllowList);
final Metadata metadata = new Metadata();
model.setAllowListMetaData(metadata);
saver.save(pathToPom, model, DeploymentMode.FORCED, "message allow list");
verify(allowListService).save(eq(pathToAllowList), eq(allowList), eq(metadata), eq("message allow list"));
}
use of org.kie.workbench.common.services.shared.allowlist.AllowList in project kie-wb-common by kiegroup.
the class PackageNameAllowListServiceImplTest method testSave.
@Test
public void testSave() throws Exception {
final PackageNameAllowListService service = makeService("");
final Path path = mock(Path.class);
final AllowList allowList = new AllowList();
final Metadata metadata = new Metadata();
final String comment = "comment";
service.save(path, allowList, metadata, comment);
verify(saver).save(path, allowList, metadata, comment);
}
use of org.kie.workbench.common.services.shared.allowlist.AllowList in project kie-wb-common by kiegroup.
the class ClassVerifierTest method testVerifyClass.
@Test
public void testVerifyClass() {
AllowList allowList = new AllowList();
allowList.add("org.kie.workbench.common.services.backend.builder");
ClassVerifier classVerifier = new ClassVerifier(kieModuleMetaData, typeSourceResolver);
List<BuildMessage> messages = classVerifier.verify(allowList);
assertEquals(messages.size(), 1);
assertEquals("Verification of class org.kie.workbench.common.services.backend.builder.SomeClass failed and will not be available for authoring.\n" + "Underlying system error is: The access to the class is not allowed. Please check the necessary external dependencies for this project are configured correctly.", messages.get(0).getText());
}
use of org.kie.workbench.common.services.shared.allowlist.AllowList in project kie-wb-common by kiegroup.
the class DependenciesPresenterTest method testAddAllToAllowList.
@Test
public void testAddAllToAllowList() {
dependenciesPresenter.model = mock(ProjectScreenModel.class);
doReturn(new AllowList()).when(dependenciesPresenter.model).getAllowList();
assertEquals(0, dependenciesPresenter.model.getAllowList().size());
dependenciesPresenter.addAllToAllowList(new HashSet<>(Arrays.asList("foo", "bar")));
assertEquals(2, dependenciesPresenter.model.getAllowList().size());
verify(enhancedDependenciesManager).update();
}
use of org.kie.workbench.common.services.shared.allowlist.AllowList 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 AllowList(), mock(DependenciesPresenter.class));
verify(view).init(any());
verify(view).setGroupId(any());
verify(view).setArtifactId(any());
verify(view).setVersion(any());
verify(view).setPackagesAllowListedState(any());
verify(view).setTransitiveDependency(eq(false));
}
Aggregations