use of org.kie.workbench.common.services.shared.kmodule.KModuleModel in project kie-wb-common by kiegroup.
the class KSessionSelectorTest method testKSessionDefinedInScenarioNoLongerExistsAndKModuleIsEmpty.
@Test
public void testKSessionDefinedInScenarioNoLongerExistsAndKModuleIsEmpty() throws Exception {
// No kbases or ksessions defined in the kmodule.xml
when(kModuleService.load(kmodulePath)).thenReturn(new KModuleModel());
selector.init(path, "ksessionThatHasBeenRemovedFromKModuleXML");
verify(view).addKBases("defaultKieBase", "---");
ArgumentCaptor<List> listArgumentCaptor = ArgumentCaptor.forClass(List.class);
verify(view).setKSessions(listArgumentCaptor.capture());
verify(view).setSelected(eq("---"), eq("ksessionThatHasBeenRemovedFromKModuleXML"));
verify(view).showWarningSelectedKSessionDoesNotExist();
List ksessionNamesList = listArgumentCaptor.getValue();
assertEquals(1, ksessionNamesList.size());
assertEquals("ksessionThatHasBeenRemovedFromKModuleXML", ksessionNamesList.get(0));
}
Aggregations