Search in sources :

Example 1 with KnowledgeBasesPresenter

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));
}
Also used : KnowledgeBasesPresenter(org.kie.workbench.common.screens.library.client.settings.knowledgebases.KnowledgeBasesPresenter) KBaseModel(org.kie.workbench.common.services.shared.kmodule.KBaseModel) Test(org.junit.Test)

Example 2 with KnowledgeBasesPresenter

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();
}
Also used : KnowledgeBasesPresenter(org.kie.workbench.common.screens.library.client.settings.knowledgebases.KnowledgeBasesPresenter) KBaseModel(org.kie.workbench.common.services.shared.kmodule.KBaseModel) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 KnowledgeBasesPresenter (org.kie.workbench.common.screens.library.client.settings.knowledgebases.KnowledgeBasesPresenter)2 KBaseModel (org.kie.workbench.common.services.shared.kmodule.KBaseModel)2