cancel
Showing results for 
Search instead for 
Did you mean: 

Integration with JUnit and Kerberos authentications

Occasional Contributor

Integration with JUnit and Kerberos authentications

I have a SoapUI project set up to use Kerberos authorization for REST web services. Now I want to itegrate this project with JUnit (https://www.soapui.org/test-automation/junit/junit-integration.html),however when I run it from eclipse all tests failed because of authorization. 

public void testRunner() throws Exception {
SoapUIProTestCaseRunner runner = new SoapUIProTestCaseRunner();
runner.setProjectFile("SoapUIWorkspace/Sample-soapui-project.xml");
runner.setPrintReport(true); 
runner.run();
}

 Is there a way to add authorization or set "Run the same process as the GUI" in TestRunner?

2 REPLIES 2
Community Hero

Re: Integration with JUnit and Kerberos authentications

You did not have any problem while running the tests from soapui and only having the problem while running it from Junit?

Have you checked the preferences -> HTTP Settings -> Authenticate Preemptively checked for outgoing requests?


Regards,
Rao.
Occasional Contributor

Re: Integration with JUnit and Kerberos authentications

I checked this, but still getting Unauthorized in JUnit. And it works fine in SoapUI GUI.

 

Error trace:

[HttpAuthenticator] NEGOTIATE authentication error: No valid credentials provided (Mechanism level: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt))

New Here?
Join us and watch the welcome video:
SeptemberNews
Join the exciting event
SeptemberHubBub
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win