OAuth token value in AuthManager update form test (groovy)
Hello all,
I am using AuthManager in my project. But unfortunetally we implemented new dynamic part of the token. So I must refresh it after each new deployment. So for CI/CD is problem.
In my AuthManager I have token value. Now I can send my HTTP to get new one.. But remains question, how to update the value in AuthManager?
Any ideas? I saw some examples with update of the use name, etc.. but somehow this is not aplicable for me.
I need just update the token value.
I dont know the object model.. And form some reason the ReadyAPI groovy step does not help me with syntax:
import com.eviware.soapui.config.AuthEntryTypeConfig;
def project = testRunner.getTestCase().getTestSuite().getProject();
def authProfile = project.getAuthRepository().getEntry("Name of your profile");
So I have no idea what are all the available variables and methods in authProfile ...
Any idea wellcomed.
def authContainer = testRunner.testCase.testSuite.project.OAuth2ProfileContainer
def authProfile = authContainer.getProfileByName("admin_default")
def oldToken = authProfile.getAccessToken();
log.info oldToken;
// updated
authProfile.setAccessToken("some");
log.info authProfile.getAccessToken();Can anybody tell me, why the helper dont know the setAccessToken method? When I am typing the code in groovy step?
I just found it by my sugesstion.. But IT MUST be somewhere descripted.. Like in object mode.. but I did not found it there..
It works.. but is stranght, that this was done by gessing...