I have little to no experience in using IDE’s but I have followed the very helpful instructions for deployment and use of the Rule Development Kit.
I have managed to clone the project. I have also written the rule (an AttrributeGenerator rule) using the SailPoint documentation.
When I run the test cases using the command line ‘mvn test -Dtest=“UniqueNameGeneratorTest”’ , I get the error (3 times - once for each test): " [ERROR] UniqueNameGeneratorTest.testUniqueLogic:92 Mockito
Mockito cannot mock this class: class sailpoint.object.Identity."
I assume this is something to do with the Test, XML or Java components not being able to find the ‘sailpoint’ class? But this is where my intelligence runs out.
Can anyone point me in the right direction? Any help you can provide would be appreciated.
I am also encountering the same Mockito error, not only with my own test class but with the provided test classes and rules from the repo. I am investigating and will let you know if I find a solution.
This could be a compatibility issue between the Java and Mockito versions. We might need to find and check either or all the possible ways to conclude which java version would be compatible with mockito version in mocking all the sailpoint classes:
Upgrade the jdk version.
Upgrade the mockito-core dependency version in pom.xml file.
You can try any of these solutions listed here if you feel the issue lies here.
This causes an additional error: “Mockito cannot mock this class: class sailpoint.object.Application”
@chris-hogan - I can also confirm I get the same error across all provided Test Classes too.
@varshini303 - I have update Java and modifed the version of mockito-core to be 5.12.0 (it was 5.2.0). However, I still get the same errors.
How can I confirm that the newly installed version of Java is being used by the Rule Dev Kit?
Also, how can I confirm that the updated version of mockito-core in the pom.xml is being used?
Once again, thanks all for your inputs and suggestions.
To check the java version used by RDK: You can run mvn -version
However, I’m not aware of how to check if the expected mockito version is used by RDK. As far as I know, just updating the version number in the pom build file and rebuilding the project would automatically update to the latest version of mockito.
Also, I believe you are using the latest repo of RDK where they have upgraded the rule-java-docs dependency to version 1.1.
Would share any if I find some other lead, thanks!