Ameer
10 years agoNew Contributor
How to add Authorization Header to a Rest Request in Java
Hi,
I am newbie to SOAP UI java Api's. Could you please help me on setting Authorization Header to a Rest Request for a test suite in java.
Please find the Step:
WsdlProject wadlProject = new WsdlProject();
WsdlTestSuite testSuite = wadlProject .addNewTestSuite("Sample Test");
WsdlTestCase testCase = testSuite.addNewTestCase("Sample Test Case");
WsdlTestStep testStep = testCase.addTestStep("httprequest","Valid","requestURL","GET");
TestCaseRunner testCaseRunner = new WsdlTestCaseRunner((WsdlTestCase)testCase, null);
TestCaseRunContext testStepContext = new WsdlTestRunContext(testStep);
testStep.run(testCaseRunner, testStepContext);
I am not sure how to set the Authorization header in the above code. Could you please help