Forum Discussion

Stalsy's avatar
3 years ago

ReadyAPi 3.10 unable to resolve class

I've just upgraded from 3.6 to 3.10.

I'm running data driven tests involving 1000's of calls, so I have groovy scripts to check and refresh the Auth2 Azure access token if the test goes more than 40 minutes. To do so I must import:


However, since the upgrade I get an error:  unable to resolve class

I have this code in every test so I'm currently completely blocked... Help!


The code to check and if necessary get a new access token:

//for every test I use the TestRunListener.beforeRun to create/intialize to 3000 seconds and property called Duration to act as a static variable.

//Then my groovy script reads the value of the Duration property and if the test has been running for more than the Duration, it gets a new token and adds // 3000 seconds to Duration:

def dur = testRunner.testCase.getPropertyValue("Duration").toInteger()

if ( testRunner.getTimeTaken() > dur)
def project = context.getTestCase().getTestSuite().getProject();

def oAuthProfile = project.getAuthRepository().getEntry("WindowsToken");
oAuthProfile.setClientSecret(testRunner.testCase.testSuite.project.getPropertyValue( "client_secret" ));
def oldToken = oAuthProfile.getAccessToken(); 'old: ' + oldToken

// the following code for getting new access token
def oAuthClientFacade = new OltuOAuth2AzureClientFacade (TokenType.ACCESS);
oAuthClientFacade.requestAccessToken(oAuthProfile, true,true);
while(oldToken == oAuthProfile.getAccessToken()) {
testRunner.testCase.setPropertyValue( "Duration", (dur+3000000).toString() )
dur = testRunner.testCase.getPropertyValue("Duration").toInteger()