19
19
20
20
package org .commonwl .view .researchobject ;
21
21
22
+ import org .apache .jena .query .ResultSet ;
22
23
import org .apache .taverna .robundle .Bundle ;
23
24
import org .apache .taverna .robundle .Bundles ;
24
25
import org .apache .taverna .robundle .manifest .Manifest ;
@@ -97,6 +98,12 @@ public void generateAndSaveROBundle() throws Exception {
97
98
when (mockCwlTool .getRDF (anyString ()))
98
99
.thenReturn ("@prefix cwl: <https://w3id.org/cwl/cwl#> ." );
99
100
101
+ // Mock RDF Service
102
+ ResultSet emptyResult = Mockito .mock (ResultSet .class );
103
+ when (emptyResult .hasNext ()).thenReturn (false );
104
+ RDFService mockRdfService = Mockito .mock (RDFService .class );
105
+ when (mockRdfService .getAuthors (anyString (), anyString ())).thenReturn (emptyResult );
106
+
100
107
// Workflow details
101
108
GitDetails lobSTRv1Details = new GitDetails ("https://github.com/common-workflow-language/workflows.git" ,
102
109
"933bf2a1a1cce32d88f88f136275535da9df0954" , "workflows/lobSTR/lobSTR-workflow.cwl" );
@@ -111,7 +118,7 @@ public void generateAndSaveROBundle() throws Exception {
111
118
// Create new RO bundle
112
119
ROBundleService bundleService = new ROBundleService (roBundleFolder .getRoot ().toPath (),
113
120
"CWL Viewer" , "https://view.commonwl.org" , 5242880 ,
114
- mockGraphvizService , mockGitService , Mockito . mock ( RDFService . class ) , mockCwlTool );
121
+ mockGraphvizService , mockGitService , mockRdfService , mockCwlTool );
115
122
Bundle bundle = bundleService .createBundle (lobSTRv1 , lobSTRv1RODetails );
116
123
Path bundleRoot = bundle .getRoot ().resolve ("workflow" );
117
124
@@ -194,6 +201,12 @@ public void filesOverLimit() throws Exception {
194
201
when (mockCwlTool .getRDF (anyString ()))
195
202
.thenReturn ("@prefix cwl: <https://w3id.org/cwl/cwl#> ." );
196
203
204
+ // Mock RDF Service
205
+ ResultSet emptyResult = Mockito .mock (ResultSet .class );
206
+ when (emptyResult .hasNext ()).thenReturn (false );
207
+ RDFService mockRdfService = Mockito .mock (RDFService .class );
208
+ when (mockRdfService .getAuthors (anyString (), anyString ())).thenReturn (emptyResult );
209
+
197
210
// Workflow details
198
211
GitDetails lobSTRv1Details = new GitDetails ("https://github.com/common-workflow-language/workflows.git" ,
199
212
"933bf2a1a1cce32d88f88f136275535da9df0954" , "workflows/lobSTR/lobSTR-workflow.cwl" );
@@ -208,7 +221,7 @@ public void filesOverLimit() throws Exception {
208
221
// Create new RO bundle
209
222
ROBundleService bundleService = new ROBundleService (roBundleFolder .getRoot ().toPath (),
210
223
"CWL Viewer" , "https://view.commonwl.org" , 0 , mockGraphvizService ,
211
- mockGitService , Mockito . mock ( RDFService . class ) , mockCwlTool );
224
+ mockGitService , mockRdfService , mockCwlTool );
212
225
Bundle bundle = bundleService .createBundle (lobSTRv1 , lobSTRv1RODetails );
213
226
214
227
Manifest manifest = bundle .getManifest ();
0 commit comments