use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class GeneralSettingsPresenterTest method testSetup.
@Test
public void testSetup() {
final ProjectScreenModel model = mock(ProjectScreenModel.class);
final POM pom = mock(POM.class);
doReturn(pom).when(model).getPOM();
doReturn(new GAV()).when(pom).getGav();
generalSettingsPresenter.setup(model).catch_(i -> {
Assert.fail("Promise should've been resolved!");
return promises.resolve();
});
verify(view).init(eq(generalSettingsPresenter));
verify(view).setName(any());
verify(view).setDescription(any());
verify(view).setGroupId(any());
verify(view).setArtifactId(any());
verify(view).setVersion(any());
verify(gavPreferences).load(any(), any(), any());
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel 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());
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ProjectScreenModelLoaderTest method testImports.
@Test
public void testImports() throws Exception {
final ProjectImports projectImports = new ProjectImports();
when(projectImportsService.load(importsPath)).thenReturn(projectImports);
final Metadata metadata = new Metadata();
when(metadataService.getMetadata(importsPath)).thenReturn(metadata);
ProjectScreenModel model = loader.load(pathToPom);
assertEquals(importsPath, model.getPathToImports());
assertEquals(projectImports, model.getProjectImports());
assertEquals(metadata, model.getProjectImportsMetaData());
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ProjectScreenModelLoaderTest method testKModule.
@Test
public void testKModule() throws Exception {
final KModuleModel kModuleModel = new KModuleModel();
when(kModuleService.load(kmoduleXMLPath)).thenReturn(kModuleModel);
final Metadata metadata = new Metadata();
when(metadataService.getMetadata(kmoduleXMLPath)).thenReturn(metadata);
ProjectScreenModel model = loader.load(pathToPom);
assertEquals(kmoduleXMLPath, model.getPathToKModule());
assertEquals(kModuleModel, model.getKModule());
assertEquals(metadata, model.getKModuleMetaData());
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ProjectScreenModelLoaderTest method testLoadPom.
@Test
public void testLoadPom() throws Exception {
final POM pom = new POM();
when(pomService.load(pathToPom)).thenReturn(pom);
final Metadata metadata = new Metadata();
when(metadataService.getMetadata(pathToPom)).thenReturn(metadata);
ProjectScreenModel model = loader.load(pathToPom);
assertEquals(pathToPom, model.getPathToPOM());
assertEquals(pom, model.getPOM());
assertEquals(metadata, model.getPOMMetaData());
}
Aggregations