You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2019/01/04 03:50:57 UTC

lucene-solr:master: SOLR-12514: Adding a positive testcase also

Repository: lucene-solr
Updated Branches:
  refs/heads/master 63dfba4c7 -> 663fa0e17


SOLR-12514: Adding a positive testcase also


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/663fa0e1
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/663fa0e1
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/663fa0e1

Branch: refs/heads/master
Commit: 663fa0e17f319b8f3a0693470fabf8315d9273ff
Parents: 63dfba4
Author: noble <no...@apache.org>
Authored: Fri Jan 4 14:50:52 2019 +1100
Committer: noble <no...@apache.org>
Committed: Fri Jan 4 14:50:52 2019 +1100

----------------------------------------------------------------------
 .../org/apache/solr/security/BasicAuthIntegrationTest.java  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/663fa0e1/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java b/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
index 61d56da..37578a9 100644
--- a/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java
@@ -245,8 +245,13 @@ public class BasicAuthIntegrationTest extends SolrCloudAuthTestCase {
       JettySolrRunner aNewJetty = cluster.startJettySolrRunner();
       SolrClient aNewClient = aNewJetty.newClient();
       try {
-        del = new UpdateRequest().deleteByQuery("*:*");
-        del.process(aNewClient, COLLECTION);
+        UpdateRequest delQuery = null;
+        delQuery = new UpdateRequest().deleteByQuery("*:*");
+        del.setBasicAuthCredentials("harry","HarryIsUberCool");
+        delQuery.process(aNewClient, COLLECTION);//this should succeed
+
+        delQuery = new UpdateRequest().deleteByQuery("*:*");
+        delQuery.process(aNewClient, COLLECTION);
         fail("This should not have succeeded without credentials");
       } catch (HttpSolrClient.RemoteSolrException e) {
         assertTrue(e.getMessage().contains("Unauthorized request"));