OpenSearch/qa
Lee Hinman 8aa0a5c111 Improve REST error handling when endpoint does not support HTTP verb, add OPTIONS support (#24437)
* Improved REST endpoint exception handling, see #15335

Also improved OPTIONS http method handling to better conform with the
http spec.

* Tidied up formatting and comments

See #15335

* Tests for #15335

* Cleaned up comments, added section number

* Swapped out tab indents for space indents

* Test class now extends ESSingleNodeTestCase

* Capture RestResponse so it can be examined in test cases

Simple addition to surface the RestResponse object so we can run tests
against it (see issue #15335).

* Refactored class name, included feedback

See #15335.

* Unit test for REST error handling enhancements

Randomizing unit test for enhanced REST response error handling. See
issue #15335 for more details.

* Cleaned up formatting

* New constructor to set HTTP method

Constructor added to support RestController test cases.

* Refactored FakeRestRequest, streamlined test case.

* Cleaned up conflicts

* Tests for #15335

* Added functionality to ignore or include path wildcards

See #15335

* Further enhancements to request handling

Refactored executeHandler to prioritize explicit path matches. See
#15335 for more information.

* Cosmetic fixes

* Refactored method handlers

* Removed redundant import

* Updated integration tests

* Refactoring to address issue #17853

* Cleaned up test assertions

* Fixed edge case if OPTIONS method randomly selected as invalid method

In this test, an OPTIONS method request is valid, and should not return
a 405 error.

* Remove redundant static modifier

* Hook the multiple PathTrie attempts into RestHandler.dispatchRequest

* Add missing space

* Correctly retrieve new handler for each Trie strategy

* Only copy headers to threadcontext once

* Fix test after REST header copying moved higher up

* Restore original params when trying the next trie candidate

* Remove OPTIONS for invalidHttpMethodArray so a 405 is guaranteed in tests

* Re-add the fix I already added and got removed during merge :-/

* Add missing GET method to test

* Add documentation to migration guide about breaking 404 -> 405 changes

* Explain boolean response, pull into local var

* fixup! Explain boolean response, pull into local var

* Encapsulate multiple HTTP methods into PathTrie<MethodHandlers>

* Add PathTrie.retrieveAll where all matching modes can be retrieved

Then TrieMatchingMode can be package private and not leak into RestController

* Include body of error with 405 responses to give hint about valid methods

* Fix missing usageService handler addition

I accidentally removed this :X

* Initialize PathTrieIterator modes with Arrays.asList

* Use "== false" instead of !

* Missing paren :-/
2017-07-07 09:01:23 -06:00
..
evil-tests Add concurrent deprecation logger test 2017-06-29 18:44:06 -04:00
full-cluster-restart test: avoid NPE 2017-07-04 20:33:02 +02:00
mixed-cluster IndexingIT should check for global checkpoints regardless of master version 2017-07-07 12:55:42 +02:00
multi-cluster-search Do not search locally if remote index pattern resolves to no indices (#25436) 2017-06-28 12:41:37 -06:00
no-bootstrap-tests Fix permissions handling on Windows spawner test 2017-04-07 06:25:24 -04:00
reindex-from-old Disable reindex-from-old tests in windows 2017-05-11 17:36:03 -04:00
rolling-upgrade Fix cluster health wait conditions in rolling restart tests 2017-07-06 14:35:07 -04:00
smoke-test-client Tests: Move cluster dependencies from runner to cluster (#24142) 2017-04-17 16:02:46 -07:00
smoke-test-http Improve REST error handling when endpoint does not support HTTP verb, add OPTIONS support (#24437) 2017-07-07 09:01:23 -06:00
smoke-test-ingest-disabled Tests: Change rest test extension from .yaml to .yml (#24659) 2017-05-16 17:24:35 -07:00
smoke-test-ingest-with-all-dependencies Scripting: Change keys for inline/stored scripts to source/id (#25127) 2017-06-09 08:29:25 -07:00
smoke-test-multinode Tests: Change rest test extension from .yaml to .yml (#24659) 2017-05-16 17:24:35 -07:00
smoke-test-plugins Tests: Change rest test extension from .yaml to .yml (#24659) 2017-05-16 17:24:35 -07:00
smoke-test-reindex-with-all-modules test: re-enable `Reindex from remote with parent join field` test no that join field type no longer always emits its fields inside search hits. 2017-07-07 10:18:13 +02:00
smoke-test-tribe-node Tests: Change rest test extension from .yaml to .yml (#24659) 2017-05-16 17:24:35 -07:00
vagrant Fix repository-hdfs plugin packaging test 2017-07-01 15:36:18 -04:00
verify-version-constants Fix docs lucene version check error message 2017-06-26 15:45:13 -07:00
wildfly Use synchronized Wildfly shutdown 2017-06-12 21:38:58 -04:00