mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Fix the issues of test cases
This commit is contained in:
@@ -45,11 +45,11 @@ public class HttpRequestParamsMatcher extends AbstractHttpRequestMatcher {
|
||||
@Override
|
||||
public boolean match(HttpRequest request) {
|
||||
for (ParamExpression paramExpression : expressions) {
|
||||
if (!paramExpression.match(request)) {
|
||||
return false;
|
||||
if (paramExpression.match(request)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private static Set<ParamExpression> parseExpressions(String... params) {
|
||||
|
@@ -240,15 +240,18 @@ public class RequestMetadata {
|
||||
RequestMetadata that = (RequestMetadata) o;
|
||||
return Objects.equals(method, that.method) &&
|
||||
Objects.equals(path, that.path) &&
|
||||
Objects.equals(params, that.params) &&
|
||||
Objects.equals(headers, that.headers) &&
|
||||
Objects.equals(consumes, that.consumes) &&
|
||||
Objects.equals(produces, that.produces);
|
||||
Objects.equals(produces, that.produces) &&
|
||||
// Metadata should not compare the values
|
||||
Objects.equals(getParamNames(), that.getParamNames()) &&
|
||||
Objects.equals(getHeaderNames(), that.getHeaderNames());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(method, path, params, headers, consumes, produces);
|
||||
// The values of metadata should not use for the hashCode() method
|
||||
return Objects.hash(method, path, consumes, produces, getParamNames(), getHeaderNames());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user