use of org.kie.workbench.common.screens.library.client.settings.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));
}
use of org.kie.workbench.common.screens.library.client.settings.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();
}
Aggregations