-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
LLRC: Test for warnings behavior #34143
Conversation
Add tests for the Low Level REST Client's strict deprecation hangling. Relates to elastic#33708
Pinging @elastic/es-core-infra |
@@ -124,9 +124,9 @@ public HttpEntity getEntity() { | |||
final Matcher matcher = WARNING_HEADER_PATTERN.matcher(warning); | |||
if (matcher.matches()) { | |||
warnings.add(matcher.group(1)); | |||
continue; | |||
} else { |
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 flipped this around because it lines up a bit better with the rest of our style.
* Emulates Elasticsearch's DeprecationLogger.formatWarning in simple | ||
* cases. We don't have that available because we're testing against 1.7. | ||
*/ | ||
private String formatWarning(String warningBody) { |
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.
static ?
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.
👍
if (strictDeprecationMode) { | ||
try { | ||
restClient.performRequest(request); | ||
fail("expected ResponseException"); |
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.
maybe clarify that we expect an exception due to a warning as strict deprecation mode is enabled?
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.
👍
|
||
} | ||
|
||
private void deprecationWarningTest(List<String> warningHeaderTexts, List<String> warningBodyTexts) throws IOException { |
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.
maybe this can be static too, and I would rename to assertDeprecationWarnings or expectDeprecationWarnings
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.
👍
Add tests for the Low Level REST Client's strict deprecation handling. Relates to #33708
Add tests for the Low Level REST Client's strict deprecation handling. Relates to #33708
Add tests for the Low Level REST Client's strict deprecation hangling.
Relates to #33708