7
7
8
8
import org .apache .http .HttpHeaders ;
9
9
import org .apache .http .HttpHost ;
10
- import org .apache .lucene .util .LuceneTestCase ;
11
10
import org .elasticsearch .Version ;
12
11
import org .elasticsearch .client .Request ;
13
12
import org .elasticsearch .client .RequestOptions ;
16
15
import org .elasticsearch .client .RestClient ;
17
16
import org .elasticsearch .common .Strings ;
18
17
import org .elasticsearch .common .xcontent .XContentBuilder ;
19
- import org .elasticsearch .rest .action .document .RestGetAction ;
20
18
import org .elasticsearch .test .rest .yaml .ObjectPath ;
21
19
22
20
import java .io .IOException ;
27
25
import static org .elasticsearch .common .xcontent .XContentFactory .jsonBuilder ;
28
26
import static org .hamcrest .Matchers .equalTo ;
29
27
30
- @ LuceneTestCase .AwaitsFix ( bugUrl = "https://github.com/elastic/elasticsearch/issues/41671" )
31
28
public class TokenBackwardsCompatibilityIT extends AbstractUpgradeTestCase {
32
29
33
30
public void testGeneratingTokenInOldCluster () throws Exception {
@@ -66,7 +63,7 @@ public void testGeneratingTokenInOldCluster() throws Exception {
66
63
assertNotNull (token );
67
64
assertTokenWorks (token );
68
65
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" );
70
67
indexRequest1 .setJsonEntity (
71
68
"{\n " +
72
69
" \" token\" : \" " + token + "\" \n " +
@@ -80,7 +77,7 @@ public void testGeneratingTokenInOldCluster() throws Exception {
80
77
token = (String ) responseMap .get ("access_token" );
81
78
assertNotNull (token );
82
79
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" );
84
81
indexRequest2 .setJsonEntity (
85
82
"{\n " +
86
83
" \" token\" : \" " + token + "\" \n " +
@@ -91,8 +88,7 @@ public void testGeneratingTokenInOldCluster() throws Exception {
91
88
public void testTokenWorksInMixedOrUpgradedCluster () throws Exception {
92
89
assumeTrue ("this test should only run against the mixed or upgraded cluster" ,
93
90
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" );
96
92
Response getResponse = client ().performRequest (getRequest );
97
93
assertOK (getResponse );
98
94
Map <String , Object > source = (Map <String , Object >) entityAsMap (getResponse ).get ("_source" );
@@ -102,8 +98,7 @@ public void testTokenWorksInMixedOrUpgradedCluster() throws Exception {
102
98
public void testMixedCluster () throws Exception {
103
99
assumeTrue ("this test should only run against the mixed cluster" , CLUSTER_TYPE == ClusterType .MIXED );
104
100
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" );
107
102
108
103
Response getResponse = client ().performRequest (getRequest );
109
104
Map <String , Object > source = (Map <String , Object >) entityAsMap (getResponse ).get ("_source" );
@@ -154,8 +149,7 @@ public void testMixedCluster() throws Exception {
154
149
155
150
public void testUpgradedCluster () throws Exception {
156
151
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" );
159
153
160
154
Response getResponse = client ().performRequest (getRequest );
161
155
assertOK (getResponse );
@@ -170,8 +164,7 @@ public void testUpgradedCluster() throws Exception {
170
164
assertOK (invalidationResponse );
171
165
assertTokenDoesNotWork (token );
172
166
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" );
175
168
176
169
getResponse = client ().performRequest (getRequest );
177
170
source = (Map <String , Object >) entityAsMap (getResponse ).get ("_source" );
0 commit comments