Search in sources :

Example 1 with KnowledgeBasesPresenter

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

Example 3 with KnowledgeBasesPresenter

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

Example 4 with KnowledgeBasesPresenter

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

Aggregations

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