Search in sources :

Example 1 with RefactoringMapPageRow

use of org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow in project kie-wb-common by kiegroup.

the class CalledElementFormProviderTest method setup.

@Before
public void setup() {
    calledElementFormProvider.setQueryService(queryService);
    List<RefactoringPageRow> results = new ArrayList<RefactoringPageRow>();
    RefactoringMapPageRow refactoringMapPageRow = new RefactoringMapPageRow();
    Map<String, Path> map = new HashMap<String, Path>();
    map.put(ID1, path1);
    map.put(ID2, path2);
    refactoringMapPageRow.setValue(map);
    results.add(refactoringMapPageRow);
    when(queryService.query(anyString(), anyObject())).thenReturn(results);
}
Also used : Path(org.uberfire.backend.vfs.Path) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) RefactoringMapPageRow(org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow) Matchers.anyString(org.mockito.Matchers.anyString) RefactoringPageRow(org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow) Before(org.junit.Before)

Example 2 with RefactoringMapPageRow

use of org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow in project kie-wb-common by kiegroup.

the class FindRuleFlowNamesQueryTest method testExistentGroup.

@Test
public void testExistentGroup() {
    properties.add(property);
    properties.add(property);
    kObjects.add(kObject);
    when(kObject.getKey()).thenReturn(FILE_PATH);
    List<RefactoringPageRow> list = testedBuilder.buildResponse(kObjects);
    assertEquals(2, list.size());
    RefactoringMapPageRow row = (RefactoringMapPageRow) list.get(0);
    assertMapPageRow(row.getValue());
    row = (RefactoringMapPageRow) list.get(1);
    assertMapPageRow(row.getValue());
}
Also used : RefactoringMapPageRow(org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow) RefactoringPageRow(org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow) Test(org.junit.Test)

Example 3 with RefactoringMapPageRow

use of org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow in project kie-wb-common by kiegroup.

the class FindRuleFlowNamesQueryTest method testNewGroupAdded.

@Test
public void testNewGroupAdded() {
    properties.add(property);
    kObjects.add(kObject);
    when(kObject.getKey()).thenReturn(FILE_PATH);
    List<RefactoringPageRow> list = testedBuilder.buildResponse(kObjects);
    RefactoringMapPageRow row = (RefactoringMapPageRow) list.get(0);
    assertEquals(1, list.size());
    Map<?, ?> map = row.getValue();
    assertEquals(3, map.size());
    assertEquals(FILE_NAME, map.get("filename"));
    assertEquals(path.toUri().toString(), map.get("pathuri"));
    assertEquals(GROUP_NAME, map.get("name"));
}
Also used : RefactoringMapPageRow(org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow) RefactoringPageRow(org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow) Test(org.junit.Test)

Example 4 with RefactoringMapPageRow

use of org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow in project kie-wb-common by kiegroup.

the class ProcessesDataServiceTest method setup.

@Before
public void setup() {
    List<RefactoringPageRow> results = new ArrayList<RefactoringPageRow>();
    RefactoringMapPageRow refactoringMapPageRow = new RefactoringMapPageRow();
    Map<String, Path> map = new HashMap<String, Path>();
    map.put(ID1, path1);
    map.put(ID2, path2);
    refactoringMapPageRow.setValue(map);
    results.add(refactoringMapPageRow);
    when(queryService.query(anyString(), anyObject())).thenReturn(results);
    tested = new ProcessesDataService(queryService, processesUpdatedEvent);
}
Also used : Path(org.uberfire.backend.vfs.Path) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ProcessesDataService(org.kie.workbench.common.stunner.bpmn.project.backend.service.ProcessesDataService) RefactoringMapPageRow(org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) RefactoringPageRow(org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow) Before(org.junit.Before)

Aggregations

RefactoringMapPageRow (org.kie.workbench.common.services.refactoring.model.query.RefactoringMapPageRow)4 RefactoringPageRow (org.kie.workbench.common.services.refactoring.model.query.RefactoringPageRow)4 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Before (org.junit.Before)2 Test (org.junit.Test)2 Path (org.uberfire.backend.vfs.Path)2 ProcessesDataService (org.kie.workbench.common.stunner.bpmn.project.backend.service.ProcessesDataService)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1 Matchers.anyString (org.mockito.Matchers.anyString)1