{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/72075695","id":72075695,"diff_hunk":"@@ -335,82 +169,88 @@ protected Settings restClientSettings() {\n         return Settings.EMPTY;\n     }\n \n-    /** Returns the REST client settings used for admin actions like cleaning up after the test has completed. */\n+    /**\n+     * Returns the REST client settings used for admin actions like cleaning up after the test has completed.\n+     */\n     protected Settings restAdminSettings() {\n         return restClientSettings(); // default to the same client settings\n     }\n \n-    @Before\n-    public void reset() throws IOException {\n-        // admin context must be available for @After always, regardless of whether the test was blacklisted\n-        adminExecutionContext.initClient(clusterUrls, restAdminSettings());\n-        adminExecutionContext.clear();\n \n-        //skip test if it matches one of the blacklist globs\n-        for (BlacklistedPathPatternMatcher blacklistedPathMatcher : blacklistPathMatchers) {\n-            String testPath = testCandidate.getSuitePath() + \"/\" + testCandidate.getTestSection().getName();\n-            assumeFalse(\"[\" + testCandidate.getTestPath() + \"] skipped, reason: blacklisted\", blacklistedPathMatcher\n-                    .isSuffixMatch(testPath));\n-        }\n-        //The client needs non static info to get initialized, therefore it can't be initialized in the before class\n-        restTestExecutionContext.initClient(clusterUrls, restClientSettings());\n-        restTestExecutionContext.clear();\n+    protected List<HttpHost> getClusterHosts() {\n+        return clusterHosts;\n+    }\n \n-        //skip test if the whole suite (yaml file) is disabled\n-        assumeFalse(buildSkipMessage(testCandidate.getSuitePath(), testCandidate.getSetupSection().getSkipSection()),\n-                testCandidate.getSetupSection().getSkipSection().skip(restTestExecutionContext.esVersion()));\n-        //skip test if the whole suite (yaml file) is disabled\n-        assumeFalse(buildSkipMessage(testCandidate.getSuitePath(), testCandidate.getTeardownSection().getSkipSection()),\n-            testCandidate.getTeardownSection().getSkipSection().skip(restTestExecutionContext.esVersion()));\n-        //skip test if test section is disabled\n-        assumeFalse(buildSkipMessage(testCandidate.getTestPath(), testCandidate.getTestSection().getSkipSection()),\n-                testCandidate.getTestSection().getSkipSection().skip(restTestExecutionContext.esVersion()));\n+    protected String getProtocol() {\n+        return \"http\";\n     }\n \n-    private static String buildSkipMessage(String description, SkipSection skipSection) {\n-        StringBuilder messageBuilder = new StringBuilder();\n-        if (skipSection.isVersionCheck()) {\n-            messageBuilder.append(\"[\").append(description).append(\"] skipped, reason: [\").append(skipSection.getReason()).append(\"] \");\n-        } else {\n-            messageBuilder.append(\"[\").append(description).append(\"] skipped, reason: features \")\n-                    .append(skipSection.getFeatures()).append(\" not supported\");\n+    /**\n+     * Get a client, building it if it hasn't been built for this test.\n+     */\n+    protected synchronized RestClient client() {\n+        if (client == null) {\n+            client = buildClient(restClientSettings());","path":"test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java","position":425,"original_position":425,"commit_id":"4d987a0a17ac56d06095af327c53c6dc8848b301","original_commit_id":"4d987a0a17ac56d06095af327c53c6dc8848b301","user":{"login":"nik9000","id":215970,"avatar_url":"https://avatars.githubusercontent.com/u/215970?v=3","gravatar_id":"","url":"https://api.github.com/users/nik9000","html_url":"https://github.com/nik9000","followers_url":"https://api.github.com/users/nik9000/followers","following_url":"https://api.github.com/users/nik9000/following{/other_user}","gists_url":"https://api.github.com/users/nik9000/gists{/gist_id}","starred_url":"https://api.github.com/users/nik9000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nik9000/subscriptions","organizations_url":"https://api.github.com/users/nik9000/orgs","repos_url":"https://api.github.com/users/nik9000/repos","events_url":"https://api.github.com/users/nik9000/events{/privacy}","received_events_url":"https://api.github.com/users/nik9000/received_events","type":"User","site_admin":false},"body":"Hmm - I originally avoided it because I thought the `ESSharedRestTestCase` descendants weren't going to use this client at all. But yeah, now that they do use it I'll just eagerly initialize the client.","created_at":"2016-07-25T14:40:19Z","updated_at":"2016-07-25T14:40:19Z","html_url":"https://github.com/elastic/elasticsearch/pull/19509#discussion_r72075695","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/19509","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/72075695"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/19509#discussion_r72075695"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/19509"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/19509","id":78062836,"html_url":"https://github.com/elastic/elasticsearch/pull/19509","diff_url":"https://github.com/elastic/elasticsearch/pull/19509.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/19509.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/19509","number":19509,"state":"open","locked":false,"title":"Add Location header to the index, update, and create APIs","user":{"login":"nik9000","id":215970,"avatar_url":"https://avatars.githubusercontent.com/u/215970?v=3","gravatar_id":"","url":"https://api.github.com/users/nik9000","html_url":"https://github.com/nik9000","followers_url":"https://api.github.com/users/nik9000/followers","following_url":"https://api.github.com/users/nik9000/following{/other_user}","gists_url":"https://api.github.com/users/nik9000/gists{/gist_id}","starred_url":"https://api.github.com/users/nik9000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nik9000/subscriptions","organizations_url":"https://api.github.com/users/nik9000/orgs","repos_url":"https://api.github.com/users/nik9000/repos","events_url":"https://api.github.com/users/nik9000/events{/privacy}","received_events_url":"https://api.github.com/users/nik9000/received_events","type":"User","site_admin":false},"body":"This adds a header that looks like `Location: /test/test/1` to the\r\nresponse for the index/create API. The requirement for the header\r\ncomes from https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\r\n\r\nhttps://tools.ietf.org/html/rfc7231#section-7.1.2 claims that relative\r\nURIs are OK. So we use an absolute path which should resolve to the\r\nappropriate location.\r\n\r\nThe biggest change in this PR is actually testing. Before this PR the\r\nREST tests didn't have access to the response code *unless* they were\r\n`catch`ing an error. This dumps the status into `$status`. Similarly\r\nthe REST tests didn't have any access to headers. This dumps all headers\r\ninto `$headers`.\r\n\r\nCloses #19079","created_at":"2016-07-19T22:51:02Z","updated_at":"2016-07-25T14:40:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"751d7232f4ea253975219194fc8c86e411f02038","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/19509/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/19509/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/19509/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/4d987a0a17ac56d06095af327c53c6dc8848b301","head":{"label":"nik9000:created_location_header","ref":"created_location_header","sha":"4d987a0a17ac56d06095af327c53c6dc8848b301","user":{"login":"nik9000","id":215970,"avatar_url":"https://avatars.githubusercontent.com/u/215970?v=3","gravatar_id":"","url":"https://api.github.com/users/nik9000","html_url":"https://github.com/nik9000","followers_url":"https://api.github.com/users/nik9000/followers","following_url":"https://api.github.com/users/nik9000/following{/other_user}","gists_url":"https://api.github.com/users/nik9000/gists{/gist_id}","starred_url":"https://api.github.com/users/nik9000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nik9000/subscriptions","organizations_url":"https://api.github.com/users/nik9000/orgs","repos_url":"https://api.github.com/users/nik9000/repos","events_url":"https://api.github.com/users/nik9000/events{/privacy}","received_events_url":"https://api.github.com/users/nik9000/received_events","type":"User","site_admin":false},"repo":{"id":11487195,"name":"elasticsearch","full_name":"nik9000/elasticsearch","owner":{"login":"nik9000","id":215970,"avatar_url":"https://avatars.githubusercontent.com/u/215970?v=3","gravatar_id":"","url":"https://api.github.com/users/nik9000","html_url":"https://github.com/nik9000","followers_url":"https://api.github.com/users/nik9000/followers","following_url":"https://api.github.com/users/nik9000/following{/other_user}","gists_url":"https://api.github.com/users/nik9000/gists{/gist_id}","starred_url":"https://api.github.com/users/nik9000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nik9000/subscriptions","organizations_url":"https://api.github.com/users/nik9000/orgs","repos_url":"https://api.github.com/users/nik9000/repos","events_url":"https://api.github.com/users/nik9000/events{/privacy}","received_events_url":"https://api.github.com/users/nik9000/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nik9000/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/nik9000/elasticsearch","forks_url":"https://api.github.com/repos/nik9000/elasticsearch/forks","keys_url":"https://api.github.com/repos/nik9000/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nik9000/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nik9000/elasticsearch/teams","hooks_url":"https://api.github.com/repos/nik9000/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/nik9000/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/nik9000/elasticsearch/events","assignees_url":"https://api.github.com/repos/nik9000/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/nik9000/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/nik9000/elasticsearch/tags","blobs_url":"https://api.github.com/repos/nik9000/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nik9000/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nik9000/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/nik9000/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nik9000/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/nik9000/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/nik9000/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/nik9000/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/nik9000/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/nik9000/elasticsearch/subscription","commits_url":"https://api.github.com/repos/nik9000/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/nik9000/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/nik9000/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/nik9000/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/nik9000/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/nik9000/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nik9000/elasticsearch/merges","archive_url":"https://api.github.com/repos/nik9000/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nik9000/elasticsearch/downloads","issues_url":"https://api.github.com/repos/nik9000/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/nik9000/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/nik9000/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/nik9000/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nik9000/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/nik9000/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/nik9000/elasticsearch/deployments","created_at":"2013-07-17T20:48:13Z","updated_at":"2014-12-15T18:37:06Z","pushed_at":"2016-07-25T14:16:34Z","git_url":"git://github.com/nik9000/elasticsearch.git","ssh_url":"git@github.com:nik9000/elasticsearch.git","clone_url":"https://github.com/nik9000/elasticsearch.git","svn_url":"https://github.com/nik9000/elasticsearch","homepage":"http://elasticsearch.org","size":231606,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"128f0276d95bca2eb9355eb6650668cd89ef86fe","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/elasticsearch/deployments","created_at":"2010-02-08T13:20:56Z","updated_at":"2016-07-25T14:26:30Z","pushed_at":"2016-07-25T14:32:48Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":344660,"stargazers_count":17543,"watchers_count":17543,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5947,"mirror_url":null,"open_issues_count":1095,"forks":5947,"open_issues":1095,"watchers":17543,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/19509"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/19509"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/19509"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/19509/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/19509/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/19509/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/4d987a0a17ac56d06095af327c53c6dc8848b301"}}}}
{"actor":{"display_login":"nik9000"}}