Search in sources :

Example 11 with AllowList

use of org.kie.workbench.common.services.shared.allowlist.AllowList in project kie-wb-common by kiegroup.

the class ProjectScreenModelLoaderTest method testAllowList.

@Test
public void testAllowList() throws Exception {
    final AllowList allowList = new AllowList();
    when(allowListService.load(packageNamesAllowListPath)).thenReturn(allowList);
    final Metadata metadata = new Metadata();
    when(metadataService.getMetadata(packageNamesAllowListPath)).thenReturn(metadata);
    ProjectScreenModel model = loader.load(pathToPom);
    assertEquals(packageNamesAllowListPath, model.getPathToAllowList());
    assertEquals(allowList, model.getAllowList());
    assertEquals(metadata, model.getAllowListMetaData());
}
Also used : Metadata(org.guvnor.common.services.shared.metadata.model.Metadata) AllowList(org.kie.workbench.common.services.shared.allowlist.AllowList) ProjectScreenModel(org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel) Test(org.junit.Test)

Example 12 with AllowList

use of org.kie.workbench.common.services.shared.allowlist.AllowList in project kie-wb-common by kiegroup.

the class ProjectScreenModelLoaderTest method testAllowListNoMetadata.

@Test
public void testAllowListNoMetadata() throws Exception {
    final AllowList allowList = new AllowList();
    testFileSystem.deleteFile(packageNamesAllowListPath);
    when(allowListService.load(packageNamesAllowListPath)).thenReturn(allowList);
    ProjectScreenModel model = loader.load(pathToPom);
    assertEquals(packageNamesAllowListPath, model.getPathToAllowList());
    assertEquals(allowList, model.getAllowList());
    assertNotNull(model.getAllowListMetaData());
}
Also used : AllowList(org.kie.workbench.common.services.shared.allowlist.AllowList) ProjectScreenModel(org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel) Test(org.junit.Test)

Aggregations

AllowList (org.kie.workbench.common.services.shared.allowlist.AllowList)12 Test (org.junit.Test)11 ProjectScreenModel (org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel)5 Metadata (org.guvnor.common.services.shared.metadata.model.Metadata)4 Path (org.uberfire.backend.vfs.Path)3 HashMap (java.util.HashMap)2 PackageNameAllowListService (org.kie.workbench.common.services.shared.allowlist.PackageNameAllowListService)2 HashSet (java.util.HashSet)1 Map (java.util.Map)1 BuildMessage (org.guvnor.common.services.project.builder.model.BuildMessage)1 MavenRepositoryMetadata (org.guvnor.common.services.project.model.MavenRepositoryMetadata)1 NormalEnhancedDependency (org.kie.workbench.common.services.shared.dependencies.NormalEnhancedDependency)1 TransitiveEnhancedDependency (org.kie.workbench.common.services.shared.dependencies.TransitiveEnhancedDependency)1 KieModule (org.kie.workbench.common.services.shared.project.KieModule)1 CommentedOption (org.uberfire.java.nio.base.options.CommentedOption)1