use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.
the class KnowledgeBaseItemPresenterTest method testSetup.
@Test
public void testSetup() {
final KnowledgeBaseItemPresenter setup = knowledgeBaseItemPresenter.setup(new KBaseModel(), mock(KnowledgeBasesPresenter.class));
Assert.assertEquals(setup, knowledgeBaseItemPresenter);
verify(view).setKnowledgeSessionsCount(anyInt());
verify(view).setDefault(anyBoolean());
verify(view).setName(any());
verify(knowledgeSessionsModal).setup(any());
verify(addPackageModal).setup(any(), any());
verify(addIncludedKnowledgeBaseModal).setup(any(), any());
verify(packageListPresenter).setup(any(), any(), any());
verify(includedKnowledgeBasesListPresenter).setup(any(), any(), any());
verify(eventProcessingModeSelect).setup(any(), any(), any(), any());
verify(equalsBehaviorSelect).setup(any(), any(), any(), any());
}
use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.
the class KnowledgeBaseItemPresenterTest method testOnDefaultKnowledgeSessionChanged.
@Test
public void testOnDefaultKnowledgeSessionChanged() {
final KBaseModel kBaseModel = new KBaseModel();
kBaseModel.setDefault(true);
knowledgeBaseItemPresenter.kBaseModel = kBaseModel;
knowledgeBaseItemPresenter.onDefaultKnowledgeSessionChanged(new DefaultKnowledgeBaseChange(kBaseModel));
Assert.assertTrue(kBaseModel.isDefault());
}
use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.
the class KnowledgeBaseItemPresenterTest method testOnDefaultKnowledgeSessionChangedWithAnotherKBaseModel.
@Test
public void testOnDefaultKnowledgeSessionChangedWithAnotherKBaseModel() {
final KBaseModel kBaseModel = new KBaseModel();
kBaseModel.setDefault(true);
knowledgeBaseItemPresenter.kBaseModel = kBaseModel;
knowledgeBaseItemPresenter.onDefaultKnowledgeSessionChanged(new DefaultKnowledgeBaseChange(mock(KBaseModel.class)));
Assert.assertFalse(kBaseModel.isDefault());
}
use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.
the class KnowledgeSessionListItemPresenterTest method testOnDefaultKnowledgeSessionChanged.
@Test
public void testOnDefaultKnowledgeSessionChanged() {
final KBaseModel kBaseModel = new KBaseModel();
final KSessionModel kSessionModel = new KSessionModel();
kSessionModel.setDefault(true);
final KnowledgeSessionsModal parentPresenter = mock(KnowledgeSessionsModal.class);
doReturn(kBaseModel).when(parentPresenter).getObject();
knowledgeSessionListItemPresenter.parentPresenter = parentPresenter;
knowledgeSessionListItemPresenter.kSessionModel = kSessionModel;
knowledgeSessionListItemPresenter.onDefaultKnowledgeSessionChanged(new DefaultKnowledgeSessionChange(kBaseModel, kSessionModel));
Assert.assertTrue(kSessionModel.isDefault());
}
use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.
the class KnowledgeSessionsModalTest method testSetup.
@Test
public void testSetup() {
final KnowledgeBaseItemPresenter parentPresenter = mock(KnowledgeBaseItemPresenter.class);
doReturn(new KBaseModel()).when(parentPresenter).getObject();
doNothing().when(knowledgeSessionsModal).superSetup();
doNothing().when(knowledgeSessionsModal).setWidth(any());
knowledgeSessionsModal.setup(parentPresenter);
verify(knowledgeSessionsModal).superSetup();
verify(knowledgeBasesListPresenter).setup(any(), any(), any());
}
Aggregations