HLRC: Fix the tags to be in sync with docs. (#34501)

Correct the tags mapping with the documentation.
This was added in #34171
This commit is contained in:
Yogesh Gaikwad 2018-10-16 05:12:11 +01:00 committed by GitHub
parent a4c302067e
commit f5ef2482df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -122,7 +122,7 @@ public class SecurityDocumentationIT extends ESRestHighLevelClientTestCase {
.build();
final PutRoleMappingRequest request = new PutRoleMappingRequest("mapping-example", true, Collections.singletonList("superuser"),
rules, null, RefreshPolicy.NONE);
// tag::put-role-mapping-execute-async
// tag::put-role-mapping-execute-listener
ActionListener<PutRoleMappingResponse> listener = new ActionListener<PutRoleMappingResponse>() {
@Override
public void onResponse(PutRoleMappingResponse response) {
@ -134,15 +134,15 @@ public class SecurityDocumentationIT extends ESRestHighLevelClientTestCase {
// <2>
}
};
// end::put-role-mapping-execute-async
// end::put-role-mapping-execute-listener
// Replace the empty listener by a blocking listener in test
final CountDownLatch latch = new CountDownLatch(1);
listener = new LatchedActionListener<>(listener, latch);
// tag::put-role-mapping-execute-listener
// tag::put-role-mapping-execute-async
client.security().putRoleMappingAsync(request, RequestOptions.DEFAULT, listener); // <1>
// end::put-role-mapping-execute-listener
// end::put-role-mapping-execute-async
assertTrue(latch.await(30L, TimeUnit.SECONDS));
}