SOLR-13637: BasicAuthIntegrationTest failures fixed

This commit is contained in:
noble 2019-07-25 04:29:15 -04:00
parent c0da27173c
commit 100c160017
2 changed files with 6 additions and 3 deletions

View File

@ -249,8 +249,9 @@ public class ApiBag {
@Override @Override
public Name getPermissionName(AuthorizationContext ctx) { public Name getPermissionName(AuthorizationContext ctx) {
if (rh instanceof PermissionNameProvider) { SolrRequestHandler handler = rh.get();
return ((PermissionNameProvider) rh).getPermissionName(ctx); if (handler instanceof PermissionNameProvider) {
return ((PermissionNameProvider) handler).getPermissionName(ctx);
} }
return null; return null;
} }

View File

@ -135,7 +135,9 @@ public class BasicAuthIntegrationTest extends SolrCloudAuthTestCase {
final SolrRequest genericReq; final SolrRequest genericReq;
if (isUseV2Api) { if (isUseV2Api) {
genericReq = new V2Request.Builder("/cluster/security/authentication").withMethod(SolrRequest.METHOD.POST).build(); genericReq = new V2Request.Builder("/cluster/security/authentication")
.withPayload(command)
.withMethod(SolrRequest.METHOD.POST).build();
} else { } else {
genericReq = new GenericSolrRequest(SolrRequest.METHOD.POST, authcPrefix, new ModifiableSolrParams()); genericReq = new GenericSolrRequest(SolrRequest.METHOD.POST, authcPrefix, new ModifiableSolrParams());
((GenericSolrRequest)genericReq).setContentWriter(new StringPayloadContentWriter(command, CommonParams.JSON_MIME)); ((GenericSolrRequest)genericReq).setContentWriter(new StringPayloadContentWriter(command, CommonParams.JSON_MIME));