The code snippet you included is the main one I've seen (in SolrCloudTestCase-derived classes at least). It's fairly simple with just that one line, though I imagine most of the complexity comes in with making sure created clients have a corresponding auth setup...
Was that (i.e. client creation) what you were hoping to find a streamlined approach for, or was there another aspect of this you had in mind? Jason On Tue, Sep 26, 2023 at 9:13 AM Eric Pugh <ep...@opensourceconnections.com> wrote: > > Has anyone found a good pattern for enabling basic auth in our tests? I > suspect that some number of tests are basically “Does this work With and > Without Basic Auth”, versus being specific to the implementation of > BasicAuth. I found TestPullReplicaWithAuth.java, and it has some code to > create a custom security.json and then load it using: > > configureCluster(2) > .addConfig("conf", configset("cloud-minimal")) > .withSecurityJson(SECURITY_JSON) > .configure(); > > Is there any simpler option? Could I have a rule that says I want basicAuth > enabled for my test? > > Eric > > > _______________________ > Eric Pugh | Founder & CEO | OpenSource Connections, LLC | 434.466.1467 | > http://www.opensourceconnections.com <http://www.opensourceconnections.com/> > | My Free/Busy <http://tinyurl.com/eric-cal> > Co-Author: Apache Solr Enterprise Search Server, 3rd Ed > <https://www.packtpub.com/big-data-and-business-intelligence/apache-solr-enterprise-search-server-third-edition-raw> > This e-mail and all contents, including attachments, is considered to be > Company Confidential unless explicitly stated otherwise, regardless of > whether attachments are marked as such. > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@solr.apache.org For additional commands, e-mail: dev-h...@solr.apache.org