TypeResolution of thirdPartyDependencies in Test #5475
-
Hey, I'm currently writing a custom rule that checks weather a call on a specific third party dependency (rxjava) is allowed based on its annotations. Therefore i need TypeResolution to resolve the Call. My rule is working as wanted so far although i can't test it because when i call my rule in a JUnit-Test, the calls to that third party can't be resolved and getResolvedCall returns null. However if i try the rule on my production code it works and the calls get resolved correctly. Do i need to do something extra in the test so it can resolve the call? I already have the dependency imported in my gradle project. Thanks for help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Did you add rxjava as And which version of detekt are you compiling against to build your custom set? I think that we added a fix for this case on the last version so I recommend you to use 1.22.0-RC2. |
Beta Was this translation helpful? Give feedback.
Did you add rxjava as
testImplementation
? That should do the trick.And which version of detekt are you compiling against to build your custom set? I think that we added a fix for this case on the last version so I recommend you to use 1.22.0-RC2.