Skip to content

Commit

Permalink
HLRC: Fix the tags to be in sync with docs. (#34501)
Browse files Browse the repository at this point in the history
Correct the tags mapping with the documentation.
This was added in #34171
  • Loading branch information
bizybot authored Oct 16, 2018
1 parent a4c3020 commit f5ef248
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void testPutRoleMapping() throws Exception {
.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) {
Expand All @@ -134,15 +134,15 @@ public void onFailure(Exception e) {
// <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));
}
Expand Down

0 comments on commit f5ef248

Please sign in to comment.