use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ExternalDataObjectsPresenterTest method testSetup.
@Test
public void testSetup() {
final ProjectScreenModel model = mock(ProjectScreenModel.class);
doReturn(new ProjectImports()).when(model).getProjectImports();
externalDataObjectsPresenter.setup(model).catch_(i -> {
Assert.fail("Promise should've been resolved!");
return promises.resolve();
});
verify(view).init(eq(externalDataObjectsPresenter));
verify(itemPresenters).setup(any(), any(), any());
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class KnowledgeBasesPresenterTest method testSetup.
@Test
public void testSetup() {
final ProjectScreenModel model = mock(ProjectScreenModel.class);
when(model.getKModule()).thenReturn(spy(new KModuleModel()));
when(model.getKModule().getKBases()).thenReturn(emptyMap());
knowledgeBasesPresenter.setup(model).catch_(i -> {
Assert.fail("Promise should've been resolved!");
return promises.resolve();
});
verify(view).init(eq(knowledgeBasesPresenter));
verify(addKnowledgeBaseModal).setup(any(), any());
verify(knowledgeBaseListPresenter).setup(any(), any(), any());
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ValidationPresenterTest method testSetup.
@Test
public void testSetup() {
final ProjectScreenModel model = mock(ProjectScreenModel.class);
doReturn(new ModuleRepositories()).when(model).getRepositories();
validationPresenter.setup(model).catch_(i -> {
Assert.fail("Promise should've been resolved!");
return promises.resolve();
});
verify(view).init(eq(validationPresenter));
verify(validationItemPresenters).setup(any(), any(), any());
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ValidationPresenterTest method testCurrentHashCode.
@Test
public void testCurrentHashCode() {
final ProjectScreenModel model = mock(ProjectScreenModel.class);
final ModuleRepositories repositories = new ModuleRepositories();
doReturn(repositories).when(model).getRepositories();
validationPresenter.setup(model);
int currentHashCode = validationPresenter.currentHashCode();
Assert.assertEquals(repositories.getRepositories().hashCode(), currentHashCode);
repositories.getRepositories().add(mock(ModuleRepositories.ModuleRepository.class));
int updatedHashCode = validationPresenter.currentHashCode();
Assert.assertEquals(repositories.getRepositories().hashCode(), updatedHashCode);
}
use of org.kie.workbench.common.screens.projecteditor.model.ProjectScreenModel in project kie-wb-common by kiegroup.
the class ProjectScreenModelLoaderTest method testRepositories.
@Test
public void testRepositories() throws Exception {
final ModuleRepositories moduleRepositories = new ModuleRepositories();
when(moduleRepositoriesService.load(repositoriesPath)).thenReturn(moduleRepositories);
ProjectScreenModel model = loader.load(pathToPom);
assertEquals(repositoriesPath, model.getPathToRepositories());
assertEquals(moduleRepositories, model.getRepositories());
}
Aggregations