When I run the following script in unit test I had a 'java.lang.IllegalArgumentException: Null newPassword parameter'.
new UserBuilder('space name').setLoginName('loginName').setAccountStatus('Inactive').update()
I could get the script working by adding .setPassword('password') into it. However, our users are LDAP users and your documentation says
'Set the user password, only applicable for "Local" type users and not for LDAP or SSO user types.'
Any ideas on how to resolve the issue?
could you please include the exception stack trace to help us identify this issue you are having.
regards Malcolm Edgar
My groovy script is a scheduled service and the error happened when I run unit test. Here are the details
java.lang.IllegalArgumentException: Null newPassword parameter
com.avoka.tm.test.JUnitTestRunner.evaluateResult(JUnitTestRunner.java:164) com.avoka.tm.test.JUnitTestRunner.runTests(JUnitTestRunner.java:106) com.avoka.tm.test.AbstractJUnitTest.invoke(AbstractJUnitTest.java:112) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) com.avoka.core.groovy.runtime.SecureStaticGroovyTask.call(SecureStaticGroovyTask.java:217) com.avoka.core.groovy.runtime.GroovyScriptRuntime.executeScript(GroovyScriptRuntime.java:243) com.avoka.core.groovy.runtime.GroovyScriptRuntime.executeScript(GroovyScriptRuntime.java:85)
Is there anything else in the stack trace, unfortunately this isn't pointing to the UserBuilder class.
Another question is around the requirements for this scheduled job. There is a capability with Security Manager to change the status of inactive user account to "Inactive" after a configurable number of days.
ah, I didn't know you could do that in the setting!!!
No, that's all the info I can get from the test result. I think I will go with the setting in security manager to deactivate users . However, it will be great for me to know why the error occurred because we may want to find an automate way to update user profile by Fluent API if needed.
Malcolm, also is passing a string 'space name' as a param when creating a UserBuilder obj correct or not?
I am trying to under why you need to pass a HttpServletRequest request as a param when construct a UserBuilder obj. You don't need to pass any param to TxnUpdater or TxnBuilder for example.