Search in sources :

Example 1 with SourceService

use of org.kie.workbench.common.services.backend.source.SourceService in project drools-wb by kiegroup.

the class GuidedDecisionTableEditorServiceImplTest method checkToSource.

@Test
@SuppressWarnings("unchecked")
public void checkToSource() {
    final Path path = mock(Path.class);
    final GuidedDecisionTable52 model = new GuidedDecisionTable52();
    final SourceService mockSourceService = mock(SourceService.class);
    when(path.toURI()).thenReturn("default://project/src/main/resources/mypackage");
    when(mockSourceServices.getServiceFor(any(org.uberfire.java.nio.file.Path.class))).thenReturn(mockSourceService);
    service.toSource(path, model);
    verify(mockSourceServices, times(1)).getServiceFor(any(org.uberfire.java.nio.file.Path.class));
    verify(mockSourceService, times(1)).getSource(any(org.uberfire.java.nio.file.Path.class), eq(model));
}
Also used : Path(org.uberfire.backend.vfs.Path) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) SourceService(org.kie.workbench.common.services.backend.source.SourceService) Test(org.junit.Test)

Aggregations

GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)1 Test (org.junit.Test)1 SourceService (org.kie.workbench.common.services.backend.source.SourceService)1 Path (org.uberfire.backend.vfs.Path)1