Skip to content

Commit 6c58a8b

Browse files
Fix TokenBackwardsCompatibilityIT unexpected type warn header
Fixes a test failure (#41671) which is due to unexpected type warning headers when version 7.0.1 was released.
1 parent f01f3d6 commit 6c58a8b

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TokenBackwardsCompatibilityIT.java

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import org.apache.http.HttpHeaders;
99
import org.apache.http.HttpHost;
10-
import org.apache.lucene.util.LuceneTestCase;
1110
import org.elasticsearch.Version;
1211
import org.elasticsearch.client.Request;
1312
import org.elasticsearch.client.RequestOptions;
@@ -16,7 +15,6 @@
1615
import org.elasticsearch.client.RestClient;
1716
import org.elasticsearch.common.Strings;
1817
import org.elasticsearch.common.xcontent.XContentBuilder;
19-
import org.elasticsearch.rest.action.document.RestGetAction;
2018
import org.elasticsearch.test.rest.yaml.ObjectPath;
2119

2220
import java.io.IOException;
@@ -27,7 +25,6 @@
2725
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
2826
import static org.hamcrest.Matchers.equalTo;
2927

30-
@LuceneTestCase.AwaitsFix( bugUrl = "https://github.com/elastic/elasticsearch/issues/41671")
3128
public class TokenBackwardsCompatibilityIT extends AbstractUpgradeTestCase {
3229

3330
public void testGeneratingTokenInOldCluster() throws Exception {
@@ -66,7 +63,7 @@ public void testGeneratingTokenInOldCluster() throws Exception {
6663
assertNotNull(token);
6764
assertTokenWorks(token);
6865

69-
Request indexRequest1 = new Request("PUT", "token_backwards_compatibility_it/doc/old_cluster_token1");
66+
Request indexRequest1 = new Request("PUT", "token_backwards_compatibility_it/_doc/old_cluster_token1");
7067
indexRequest1.setJsonEntity(
7168
"{\n" +
7269
" \"token\": \"" + token + "\"\n" +
@@ -80,7 +77,7 @@ public void testGeneratingTokenInOldCluster() throws Exception {
8077
token = (String) responseMap.get("access_token");
8178
assertNotNull(token);
8279
assertTokenWorks(token);
83-
Request indexRequest2 = new Request("PUT", "token_backwards_compatibility_it/doc/old_cluster_token2");
80+
Request indexRequest2 = new Request("PUT", "token_backwards_compatibility_it/_doc/old_cluster_token2");
8481
indexRequest2.setJsonEntity(
8582
"{\n" +
8683
" \"token\": \"" + token + "\"\n" +
@@ -91,8 +88,7 @@ public void testGeneratingTokenInOldCluster() throws Exception {
9188
public void testTokenWorksInMixedOrUpgradedCluster() throws Exception {
9289
assumeTrue("this test should only run against the mixed or upgraded cluster",
9390
CLUSTER_TYPE == ClusterType.MIXED || CLUSTER_TYPE == ClusterType.UPGRADED);
94-
Request getRequest = new Request("GET", "token_backwards_compatibility_it/doc/old_cluster_token1");
95-
getRequest.setOptions(expectWarnings(RestGetAction.TYPES_DEPRECATION_MESSAGE));
91+
Request getRequest = new Request("GET", "token_backwards_compatibility_it/_doc/old_cluster_token1");
9692
Response getResponse = client().performRequest(getRequest);
9793
assertOK(getResponse);
9894
Map<String, Object> source = (Map<String, Object>) entityAsMap(getResponse).get("_source");
@@ -102,8 +98,7 @@ public void testTokenWorksInMixedOrUpgradedCluster() throws Exception {
10298
public void testMixedCluster() throws Exception {
10399
assumeTrue("this test should only run against the mixed cluster", CLUSTER_TYPE == ClusterType.MIXED);
104100
assumeTrue("the master must be on the latest version before we can write", isMasterOnLatestVersion());
105-
Request getRequest = new Request("GET", "token_backwards_compatibility_it/doc/old_cluster_token2");
106-
getRequest.setOptions(expectWarnings(RestGetAction.TYPES_DEPRECATION_MESSAGE));
101+
Request getRequest = new Request("GET", "token_backwards_compatibility_it/_doc/old_cluster_token2");
107102

108103
Response getResponse = client().performRequest(getRequest);
109104
Map<String, Object> source = (Map<String, Object>) entityAsMap(getResponse).get("_source");
@@ -154,8 +149,7 @@ public void testMixedCluster() throws Exception {
154149

155150
public void testUpgradedCluster() throws Exception {
156151
assumeTrue("this test should only run against the mixed cluster", CLUSTER_TYPE == ClusterType.UPGRADED);
157-
Request getRequest = new Request("GET", "token_backwards_compatibility_it/doc/old_cluster_token2");
158-
getRequest.setOptions(expectWarnings(RestGetAction.TYPES_DEPRECATION_MESSAGE));
152+
Request getRequest = new Request("GET", "token_backwards_compatibility_it/_doc/old_cluster_token2");
159153

160154
Response getResponse = client().performRequest(getRequest);
161155
assertOK(getResponse);
@@ -170,8 +164,7 @@ public void testUpgradedCluster() throws Exception {
170164
assertOK(invalidationResponse);
171165
assertTokenDoesNotWork(token);
172166

173-
getRequest = new Request("GET", "token_backwards_compatibility_it/doc/old_cluster_token1");
174-
getRequest.setOptions(expectWarnings(RestGetAction.TYPES_DEPRECATION_MESSAGE));
167+
getRequest = new Request("GET", "token_backwards_compatibility_it/_doc/old_cluster_token1");
175168

176169
getResponse = client().performRequest(getRequest);
177170
source = (Map<String, Object>) entityAsMap(getResponse).get("_source");

0 commit comments

Comments
 (0)