mirror of https://github.com/apache/lucene.git
SOLR-12514: Adding a positive testcase also
This commit is contained in:
parent
63dfba4c7d
commit
663fa0e17f
|
@ -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"));
|
||||
|
|
Loading…
Reference in New Issue