use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.
the class KnowledgeBasesPresenterTest method testNewKBaseModelNonEmptyMap.
@Test
public void testNewKBaseModelNonEmptyMap() {
doReturn(singletonList(new KBaseModel())).when(knowledgeBaseListPresenter).getObjectsList();
final KBaseModel kBaseModel = knowledgeBasesPresenter.newKBaseModel("Name");
Assert.assertEquals("Name", kBaseModel.getName());
Assert.assertEquals(false, kBaseModel.isDefault());
}
use of org.kie.workbench.common.services.shared.kmodule.KBaseModel in project kie-wb-common by kiegroup.
the class KnowledgeBasesPresenterTest method testNewKBaseModelEmptyMap.
@Test
public void testNewKBaseModelEmptyMap() {
doReturn(emptyList()).when(knowledgeBaseListPresenter).getObjectsList();
final KBaseModel kBaseModel = knowledgeBasesPresenter.newKBaseModel("Name");
Assert.assertEquals("Name", kBaseModel.getName());
Assert.assertEquals(true, kBaseModel.isDefault());
}
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());
}
Aggregations