-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AJ-1490, AJ-423: update workbench-libs and mockserver #1250
Changes from all commits
5c1154b
19d4a77
78fa596
721f7f9
28c8da8
01587ef
6f3024f
92e996f
a8c6478
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ object Merging { | |
case x if x.endsWith("kotlin-stdlib.kotlin_module") => MergeStrategy.first | ||
case x if x.contains("bouncycastle") => MergeStrategy.first | ||
case x if x.endsWith("kotlin-stdlib-common.kotlin_module") => MergeStrategy.first | ||
case x if x.endsWith("okio.kotlin_module") => MergeStrategy.first | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this fixes an issue in |
||
case x if x.endsWith("arrow-git.properties") => MergeStrategy.concat | ||
|
||
// For the following error: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import org.mockserver.model.HttpClassCallback.callback | |
import org.mockserver.model.HttpRequest._ | ||
import org.mockserver.model.HttpResponse._ | ||
import akka.http.scaladsl.model.StatusCodes._ | ||
import com.google.common.net.UrlEscapers | ||
import spray.json._ | ||
|
||
/** | ||
|
@@ -152,7 +153,7 @@ object MockWorkspaceServer { | |
.withHeader(authHeader) | ||
.withPath(s"${workspaceBasePath}/%s/%s/submissions" | ||
.format(mockValidWorkspace.namespace, mockValidWorkspace.name))) | ||
.callback( | ||
.respond( | ||
callback(). | ||
withCallbackClass("org.broadinstitute.dsde.firecloud.mock.ValidSubmissionCallback") | ||
) | ||
|
@@ -163,7 +164,7 @@ object MockWorkspaceServer { | |
.withMethod("POST") | ||
.withPath(s"${workspaceBasePath}/%s/%s/submissions/validate" | ||
.format(mockValidWorkspace.namespace, mockValidWorkspace.name))) | ||
.callback( | ||
.respond( | ||
callback(). | ||
withCallbackClass("org.broadinstitute.dsde.firecloud.mock.ValidSubmissionCallback") | ||
) | ||
|
@@ -276,7 +277,7 @@ object MockWorkspaceServer { | |
request() | ||
.withMethod("GET") | ||
.withPath(s"${workspaceBasePath}/%s/%s/submissions/%s/workflows/%s" | ||
.format(mockSpacedWorkspace.namespace, mockSpacedWorkspace.name, mockValidId, mockValidId))) | ||
.format(mockSpacedWorkspace.namespace, UrlEscapers.urlPathSegmentEscaper().escape(mockSpacedWorkspace.name), mockValidId, mockValidId))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are syntax/behavior differences in the updated mockserver library, as are almost all the other changes in this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see you only had to do this URL escaping once in this PR...but it also looks pretty ugly -- if you had to do this 20 times, once for each test case, what would your solution look like? I'm asking not because I want you to implement that solution (since this is just a one-off) but just curious what it'd look like in Scala :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would take one of two routes: wrap the escaping in something terser, like .withPath(s"${workspaceBasePath}/%s/%s/submissions/%s/workflows/%s"
.format(mockSpacedWorkspace.namespace, escapePathSegment(mockSpacedWorkspace.name), mockValidId, mockValidId))) this isn't a big win, but it's nicer. Alternately, I would make an implicit class that provides methods for strings; then, I could call my custom method directly on the thing I wanted to escape: implicit class StringEscaper(s: String) {
def escape: String = UrlEscapers.urlPathSegmentEscaper().escape(s)
}
…
.withPath(s"${workspaceBasePath}/%s/%s/submissions/%s/workflows/%s"
.format(mockSpacedWorkspace.namespace, mockSpacedWorkspace.name.escape, mockValidId, mockValidId)))
|
||
.respond( | ||
response() | ||
.withHeaders(header) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the workbench-libs updates hit a conflict with Orch's older version of mockserver, so I needed to update mockserver too.