-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
adds support for multiple mocks and service prefix #1570
Conversation
code blocks refactoring for better mainteinance
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.
thanks for this, this is good stuff. requested minor changes
File mock; | ||
|
||
@Option(names = {"-m", "--mocks"}, split = ",", description = "one or more mock server files") |
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.
I'd like both --mock
and --mocks
to have the exact same behavior. can you check if this is possible with picocli
@Option(names = {"-m", "--mocks"}, split = ",", description = "one or more mock server files") | ||
List<File> mocks; | ||
|
||
@Option(names = {"-P", "--prefix"}, description = "mock server prefix (contextPath)") |
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.
this is good. can you update the description to mock server path prefix (context-path)
MockServer.Builder builder = MockServer | ||
.feature(mock) | ||
.featureFiles(features) | ||
.prefix(prefix) |
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.
rename builder method to pathPrefix()
@@ -263,12 +322,12 @@ public boolean methodIs(String name) { // TODO no more supporting array arg | |||
|
|||
public boolean typeContains(String text) { | |||
String contentType = LOCAL_REQUEST.get().getContentType(); | |||
return contentType == null ? false : contentType.contains(text); | |||
return contentType != null && contentType.contains(text); |
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.
thanks :)
at a path defined by [pathPrefix] ref #1570
@ivangsa when you can review the last commit - do comment. I think being able to "mount" a mock on a URL path provides for some good flexibility |
looks more consistent now, but introduces an unnecesary breaking change for mocks that are already setting the prefix withouth first "/"
leads to:
maybe it's just a matter to adding the "/" if is missing inside |
@ivangsa ok I'll take care of that |
Description
adds support for multiple mocks and service prefix