Last active
August 7, 2019 08:44
-
-
Save code-atom/834c6627566994dce7a60132ab6abe95 to your computer and use it in GitHub Desktop.
Set Auth Profile API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.eviware.soapui.config.CredentialsConfig; | |
for(testSuiteItem in testSuite.project.getTestSuiteList()) { | |
for( testCaseItem in testSuiteItem.getTestCaseList()) { | |
for( testStep in testCaseItem.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep) ) { | |
log.info("Setting basic auth for all REST test requests in testStep ["+testStep.getName()+"]") | |
testStep.getTestRequest().setEndpoint('https://localhost'); | |
testStep.getTestRequest().setSelectedAuthProfileAndAuthType("TEST_DM_TOKEN", com.eviware.soapui.config.CredentialsConfig.AuthType.O_AUTH_2_0); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment