use of org.kie.workbench.common.screens.library.client.settings.sections.knowledgebases.KnowledgeBasesPresenter in project kie-wb-common by kiegroup.
the class KnowledgeBaseItemPresenterTest method testSetDefault.
@Test
public void testSetDefault() {
final KBaseModel kBaseModel = new KBaseModel();
kBaseModel.setDefault(false);
final KnowledgeBasesPresenter parentPresenter = mock(KnowledgeBasesPresenter.class);
knowledgeBaseItemPresenter.kBaseModel = kBaseModel;
knowledgeBaseItemPresenter.parentPresenter = parentPresenter;
knowledgeBaseItemPresenter.setDefault(true);
Assert.assertTrue(kBaseModel.isDefault());
verify(defaultKnowledgeBaseChangeEvent).fire(any());
verify(parentPresenter).fireChangeEvent();
}
use of org.kie.workbench.common.screens.library.client.settings.sections.knowledgebases.KnowledgeBasesPresenter in project kie-wb-common by kiegroup.
the class KnowledgeBaseItemPresenterTest method testAddPackage.
@Test
public void testAddPackage() {
KnowledgeBasesPresenter parentPresenter = mock(KnowledgeBasesPresenter.class);
knowledgeBaseItemPresenter.setup(new KBaseModel(), parentPresenter);
knowledgeBaseItemPresenter.addPackage();
verify(packageListPresenter).add(any());
verify(parentPresenter).fireChangeEvent();
}
use of org.kie.workbench.common.screens.library.client.settings.sections.knowledgebases.KnowledgeBasesPresenter in project kie-wb-common by kiegroup.
the class KnowledgeBaseItemPresenterTest method testAddNewIncludedKnowledgeBase.
@Test
public void testAddNewIncludedKnowledgeBase() {
KnowledgeBasesPresenter parentPresenter = mock(KnowledgeBasesPresenter.class);
knowledgeBaseItemPresenter.setup(new KBaseModel(), parentPresenter);
knowledgeBaseItemPresenter.addNewIncludedKnowledgeBase();
verify(includedKnowledgeBasesListPresenter).add(any());
verify(parentPresenter).fireChangeEvent();
}
use of org.kie.workbench.common.screens.library.client.settings.sections.knowledgebases.KnowledgeBasesPresenter in project kie-wb-common by kiegroup.
the class KnowledgeBaseItemPresenterTest method testSignalAddedOrRemoved.
@Test
public void testSignalAddedOrRemoved() {
final KBaseModel kBaseModel = new KBaseModel();
final KnowledgeBasesPresenter parentPresenter = mock(KnowledgeBasesPresenter.class);
knowledgeBaseItemPresenter.kBaseModel = kBaseModel;
knowledgeBaseItemPresenter.parentPresenter = parentPresenter;
knowledgeBaseItemPresenter.signalAddedOrRemoved();
verify(parentPresenter).fireChangeEvent();
verify(view).setKnowledgeSessionsCount(eq(0));
}
Aggregations