Forum Discussion

NataliaB's avatar
NataliaB
Occasional Contributor
9 years ago

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

  • nmrao's avatar
    nmrao
    Champion Level 3
    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?
    • NataliaB's avatar
      NataliaB
      Occasional Contributor

      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))