use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ProjectScreenModelLoaderTest method testWhiteList.
@Test
public void testWhiteList() throws Exception {
final WhiteList whiteList = new WhiteList();
when(whiteListService.load(packageNamesWhiteListPath)).thenReturn(whiteList);
final Metadata metadata = new Metadata();
when(metadataService.getMetadata(packageNamesWhiteListPath)).thenReturn(metadata);
ProjectScreenModel model = loader.load(pathToPom);
assertEquals(packageNamesWhiteListPath, model.getPathToWhiteList());
assertEquals(whiteList, model.getWhiteList());
assertEquals(metadata, model.getWhiteListMetaData());
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ProjectScreenModelSaverTest method testBatchSave.
@Test
public void testBatchSave() throws Exception {
final CommentedOption commentedOption = new CommentedOption("hello");
when(commentedOptionFactory.makeCommentedOption("message")).thenReturn(commentedOption);
saver.save(pathToPom, new ProjectScreenModel(), DeploymentMode.FORCED, "message");
verify(ioService).startBatch(any(FileSystem.class), eq(commentedOption));
verify(ioService).endBatch();
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ProjectScreenModelSaverTest method testKModuleSave.
@Test
public void testKModuleSave() throws Exception {
final ProjectScreenModel model = new ProjectScreenModel();
final KModuleModel kModule = new KModuleModel();
model.setKModule(kModule);
final Path pathToKModule = mock(Path.class);
model.setPathToKModule(pathToKModule);
final Metadata metadata = new Metadata();
model.setKModuleMetaData(metadata);
saver.save(pathToPom, model, DeploymentMode.FORCED, "message kmodule");
verify(kModuleService).save(eq(pathToKModule), eq(kModule), eq(metadata), eq("message kmodule"));
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ProjectScreenModelSaverTest method testPOMSave.
@Test
public void testPOMSave() throws Exception {
final ProjectScreenModel model = new ProjectScreenModel();
final POM pom = new POM();
model.setPOM(pom);
final Metadata pomMetaData = new Metadata();
model.setPOMMetaData(pomMetaData);
saver.save(pathToPom, model, DeploymentMode.FORCED, "message");
verify(pomService).save(eq(pathToPom), eq(pom), eq(pomMetaData), eq("message"));
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ProjectScreenModelSaverTest method testWhiteListSave.
@Test
public void testWhiteListSave() throws Exception {
final ProjectScreenModel model = new ProjectScreenModel();
final WhiteList whiteList = new WhiteList();
model.setWhiteList(whiteList);
final Path pathToWhiteList = mock(Path.class);
model.setPathToWhiteList(pathToWhiteList);
final Metadata metadata = new Metadata();
model.setWhiteListMetaData(metadata);
saver.save(pathToPom, model, DeploymentMode.FORCED, "message white list");
verify(whiteListService).save(eq(pathToWhiteList), eq(whiteList), eq(metadata), eq("message white list"));
}
Aggregations