Check timeZone argument in AbstractSqlQueryRequest#31822
Check timeZone argument in AbstractSqlQueryRequest#31822cbuescher merged 4 commits intoelastic:masterfrom hanbj:timeZone
Conversation
cbuescher
left a comment
There was a problem hiding this comment.
Great catch @hanbj, makes sense to me. This also shows we are lacking a unit test for this method. Could you add one to SqlQueryRequestTests that checks that the right the exception is thrown when this setter is called (expectThrows() is a good helper method for that).
|
Pinging @elastic/es-search-aggs |
cbuescher
left a comment
There was a problem hiding this comment.
Thanks a lot for adding the test, I left two small comments.
| } | ||
|
|
||
| @Test | ||
| protected void testTimeZone() { |
There was a problem hiding this comment.
Thanks. Could you make this method public and remove the annotation please? We don't use the "@test" annotation in our tests, although I know it is common elsewhere, but it will fail our code style check. Also, could you rename the test method to something making clear this tests only the exception, e.g. testTimeZoneNullException.
| @Test | ||
| protected void testTimeZone() { | ||
| final SqlQueryRequest sqlQueryRequest = createTestInstance(); | ||
| IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> sqlQueryRequest.timeZone((TimeZone)null)); |
There was a problem hiding this comment.
I think the cast can be removed, there is only one method.
|
@cbuescher Thank you for your guidance. |
|
@elasticmachine test this please |
|
@elasticmachien test this please |
A value of `null` will throw an IAE.
* 6.x: [ML] Fix master node deadlock during ML daily maintenance (#31836) Build: Switch integ-test-zip to OSS-only (#31866) Build: Fix detection of Eclipse Compiler Server (#31838) SQL: Remove restriction for single column grouping (#31818) Docs: Inconsistency between description and example (#31858) Fix and reenable TribeIntegrationTests QA: build improvements related to SQL projects (#31862) muted test [Docs] Add clarification to analysis example (#31826) Check timeZone() argument in AbstractSqlQueryRequest (#31822) Remove obsolete parameters from analyze rest spec (#31795) SQL: Fix incorrect HAVING equality (#31820) Smaller aesthetic fixes to InternalTestCluster (#31831) [Docs] Clarify accepted sort case (#31605) Do not return all indices if a specific alias is requested via get aliases api. (#29538) [Docs] Fix wrong link in Korean analyzer docs (#31815) Fix profiling of ordered terms aggs (#31814) Fix handling of points_only with term strategy in geo_shape (#31766) Docs: Explain _bulk?refresh shard targeting REST high-level client: add get index API (#31703)
* master: [ML] Fix master node deadlock during ML daily maintenance (#31836) Build: Switch integ-test-zip to OSS-only (#31866) SQL: Remove restriction for single column grouping (#31818) Build: Fix detection of Eclipse Compiler Server (#31838) Docs: Inconsistency between description and example (#31858) Re-enable bwc tests now that #29538 has been backported and 6.x intake build succeeded. QA: build improvements related to SQL projects (#31862) [Docs] Add clarification to analysis example (#31826) Check timeZone() argument in AbstractSqlQueryRequest (#31822) SQL: Fix incorrect HAVING equality (#31820) Smaller aesthetic fixes to InternalTestCluster (#31831) [Docs] Clarify accepted sort case (#31605) Temporarily disable bwc test in order to backport #29538 Remove obsolete parameters from analyze rest spec (#31795) [Docs] Fix wrong link in Korean analyzer docs (#31815) Fix profiling of ordered terms aggs (#31814) Properly mute test involving JDK11 closes #31739 Do not return all indices if a specific alias is requested via get aliases api. (#29538) Get snapshot rest client cleanups (#31740) Docs: Explain _bulk?refresh shard targeting Fix handling of points_only with term strategy in geo_shape (#31766)
I think it's not to judge whether timeZone is null.