use of org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RequestRuleFlowGroupDataEvent in project kie-wb-common by kiegroup.
the class RuleFlowGroupFormProvider method populateData.
@PostConstruct
public void populateData() {
requestRuleFlowGroupDataEvent.fire(new RequestRuleFlowGroupDataEvent());
requestRuleFlowGroupDataEventEventSingleton = requestRuleFlowGroupDataEvent;
}
use of org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RequestRuleFlowGroupDataEvent in project kie-wb-common by kiegroup.
the class RuleFlowGroupFormProviderTest method testGroupWithSameProject.
@Test
public void testGroupWithSameProject() {
RuleFlowGroup group1 = new RuleFlowGroup("g1");
group1.setPathUri("default://main@MySpace/Project1/src/main/resources/com/myspace/project1/RulesFile.rdrl");
RuleFlowGroup group2 = new RuleFlowGroup("g1");
group2.setPathUri("default://main@MySpace/Project1/src/main/resources/com/myspace/RulesFile2.rdrl".replace('/', '\\'));
RuleFlowGroup group3 = new RuleFlowGroup("g1");
group3.setPathUri("default://main@MySpace/Project2/src/main/resources/com/myspace/project1/RulesFile.rdrl");
List<RuleFlowGroup> groups = Arrays.asList(group1, group2, group3);
when(dataProvider.getRuleFlowGroupNames()).thenReturn(groups);
FormRenderingContext context = mock(FormRenderingContext.class);
SelectorData<String> data = tested.getSelectorData(context);
Map<String, String> values = data.getValues();
assertNotNull(values);
assertEquals(1, values.size());
assertEquals("g1 [Project1, Project2]", values.get(group1.getName()));
verify(requestRuleFlowGroupDataEvent, times(1)).fire(any(RequestRuleFlowGroupDataEvent.class));
}
use of org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RequestRuleFlowGroupDataEvent in project kie-wb-common by kiegroup.
the class RuleFlowGroupFormProviderTest method testGetSelectorData.
@Test
@SuppressWarnings("unchecked")
public void testGetSelectorData() {
RuleFlowGroup group1 = new RuleFlowGroup("g1");
group1.setPathUri("default://main@MySpace/Project1/src/main/resources/com/myspace/project1/RulesFile.rdrl");
RuleFlowGroup group2 = new RuleFlowGroup("g2");
group2.setPathUri("default://main@MySpace/Project1/src/main/resources/com/myspace/RulesFile2.rdrl".replace('/', '\\'));
RuleFlowGroup group3 = new RuleFlowGroup("g1");
group3.setPathUri("default://main@MySpace/Project2/src/main/resources/com/myspace/project1/RulesFile.rdrl");
List<RuleFlowGroup> groups = Arrays.asList(group1, group2, group3);
when(dataProvider.getRuleFlowGroupNames()).thenReturn(groups);
FormRenderingContext context = mock(FormRenderingContext.class);
SelectorData data = tested.getSelectorData(context);
Map<String, String> values = data.getValues();
assertNotNull(values);
assertEquals(2, values.size());
assertEquals("g2 [Project1]", values.get(group2.getName()));
assertEquals("g1 [Project1, Project2]", values.get(group1.getName()));
verify(requestRuleFlowGroupDataEvent, times(1)).fire(any(RequestRuleFlowGroupDataEvent.class));
}
use of org.kie.workbench.common.stunner.bpmn.forms.dataproviders.RequestRuleFlowGroupDataEvent in project kie-wb-common by kiegroup.
the class RuleFlowGroupDataServiceTest method testRuleFlowGroupDataService.
@Test
public void testRuleFlowGroupDataService() {
RuleFlowGroupDataService tested = spy(new RuleFlowGroupDataService(queryService, dataChangedEvent));
tested.onRequestRuleFlowGroupDataEvent(new RequestRuleFlowGroupDataEvent());
verify(tested).fireData();
}
Aggregations