File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
src/test/java/org/commonwl/view Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -119,14 +119,15 @@ public void setUp() throws Exception {
119
119
when (lobSTRdraft3 .getID ()).thenReturn ("testID" );
120
120
when (lobSTRdraft3 .getRetrievedFrom ()).thenReturn (lobSTRdraft3Details );
121
121
when (lobSTRdraft3 .getLastCommit ()).thenReturn ("933bf2a1a1cce32d88f88f136275535da9df0954" );
122
- when (lobSTRdraft3 .getIdentifier ()).thenReturn ("https://w3id.org/cwl/view/git/" +
123
- "933bf2a1a1cce32d88f88f136275535da9df0954/workflows/lobSTR/lobSTR-workflow.cwl" );
122
+ final String permalink = "https://w3id.org/cwl/view/git/" +
123
+ "933bf2a1a1cce32d88f88f136275535da9df0954/workflows/lobSTR/lobSTR-workflow.cwl" ;
124
+ when (lobSTRdraft3 .getIdentifier ()).thenReturn (permalink );
125
+ when (lobSTRdraft3 .getPermalink ()).thenReturn (permalink );
124
126
when (lobSTRdraft3 .getPermalink (any ())).thenAnswer (new Answer <String >() {
125
127
@ Override
126
128
public String answer (InvocationOnMock invocation ) throws Throwable {
127
129
Object [] args = invocation .getArguments ();
128
- return "https://w3id.org/cwl/view/git/933bf2a1a1cce32d88f88f136275535da9df0954/" +
129
- "workflows/lobSTR/lobSTR-workflow.cwl?format=" + args [0 ];
130
+ return permalink + "?format=" + args [0 ];
130
131
}
131
132
});
132
133
}
Original file line number Diff line number Diff line change 34
34
35
35
import java .io .File ;
36
36
import java .io .FileInputStream ;
37
+ import java .util .Optional ;
37
38
38
39
import static org .mockito .Matchers .*;
39
40
import static org .mockito .Mockito .when ;
@@ -61,9 +62,15 @@ public void setUp() throws Exception {
61
62
.thenReturn (new GitDetails ("https://github.com/MarkRobbo/workflows.git" ,
62
63
"master" , "path/to/workflow.cwl" ));
63
64
65
+
66
+
64
67
WorkflowService mockWorkflowService = Mockito .mock (WorkflowService .class );
65
- when (mockWorkflowService .findByCommitAndPath (anyString (), anyString ()))
66
- .thenReturn (mockWorkflow );
68
+ when (mockWorkflowService .findByCommitAndPath (anyString (), anyString (), anyObject ()))
69
+ .thenReturn (mockWorkflow );
70
+
71
+ when (mockWorkflowService .findRawBaseForCommit (anyString ())).thenReturn (
72
+ Optional .of ("https://raw.githubusercontent.com/MarkRobbo/workflows/commitidhere/" ));
73
+
67
74
when (mockWorkflowService .getWorkflowGraph (eq ("svg" ), anyObject ())).thenReturn (svg );
68
75
when (mockWorkflowService .getWorkflowGraph (eq ("png" ), anyObject ())).thenReturn (png );
69
76
when (mockWorkflowService .getWorkflowGraph (eq ("xdot" ), anyObject ())).thenReturn (dot );
You can’t perform that action at this time.
0 commit comments