Browse Source

Fix test compile issue

Rebasing #64259 on top of #64031 introduced a test compile error, but
it looks like PR-CI failed to run the correct set of checks so the PR
was green and was merged.

This change fixes those compile issues.
Tim Vernum 5 years ago
parent
commit
001d16cea3

+ 6 - 6
x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/TokenServiceTests.java

@@ -527,12 +527,12 @@ public class TokenServiceTests extends ESTestCase {
         when(securityMainIndex.indexExists()).thenReturn(true);
         TokenService tokenService = createTokenService(tokenServiceEnabledSettings, systemUTC());
         Authentication authentication = new Authentication(new User("joe", "admin"), new RealmRef("native_realm", "native", "node1"), null);
-        PlainActionFuture<Tuple<String, String>> tokenFuture = new PlainActionFuture<>();
+        PlainActionFuture<TokenService.CreateTokenResult> tokenFuture = new PlainActionFuture<>();
         final String userTokenId = UUIDs.randomBase64UUID();
         final String rawRefreshToken = UUIDs.randomBase64UUID();
         tokenService.createOAuth2Tokens(userTokenId, rawRefreshToken, authentication, authentication, Collections.emptyMap(), tokenFuture);
-        final String accessToken = tokenFuture.get().v1();
-        final String clientRefreshToken = tokenFuture.get().v2();
+        final String accessToken = tokenFuture.get().getAccessToken();
+        final String clientRefreshToken = tokenFuture.get().getRefreshToken();
         assertNotNull(accessToken);
         mockFindTokenFromRefreshToken(rawRefreshToken, buildUserToken(tokenService, userTokenId, authentication), null);
 
@@ -553,12 +553,12 @@ public class TokenServiceTests extends ESTestCase {
         when(securityMainIndex.indexExists()).thenReturn(true);
         TokenService tokenService = createTokenService(tokenServiceEnabledSettings, systemUTC());
         Authentication authentication = new Authentication(new User("joe", "admin"), new RealmRef("native_realm", "native", "node1"), null);
-        PlainActionFuture<Tuple<String, String>> tokenFuture = new PlainActionFuture<>();
+        PlainActionFuture<TokenService.CreateTokenResult> tokenFuture = new PlainActionFuture<>();
         final String userTokenId = UUIDs.randomBase64UUID();
         final String rawRefreshToken = UUIDs.randomBase64UUID();
         tokenService.createOAuth2Tokens(userTokenId, rawRefreshToken, authentication, authentication, Collections.emptyMap(), tokenFuture);
-        final String accessToken = tokenFuture.get().v1();
-        final String clientRefreshToken = tokenFuture.get().v2();
+        final String accessToken = tokenFuture.get().getAccessToken();
+        final String clientRefreshToken = tokenFuture.get().getRefreshToken();
         assertNotNull(accessToken);
         mockFindTokenFromRefreshToken(rawRefreshToken, buildUserToken(tokenService, userTokenId, authentication),
             new RefreshTokenStatus(true, randomAlphaOfLength(12), randomAlphaOfLength(6), false, null, null, null, null)