Closed ixuz closed 5 months ago
Hi @ixuz, I'm afraid this is a limitation of Mockito. Have a look at https://github.com/mockito/mockito/issues/3273 for further information.
Thanks so so much for the quick reply 👍
Yes, seems to be related to the GL11
classhaving native
methods.
Tbh, I don't know exactly what that means, but thank you for the reference to the relevant issue.
On a final note, do you have any recommendation on how to unit test these kind of methods?
Meanwhile, I'll close this issue, as it seems like problem is more related to Mockito than LWJGL.
On a final note, do you have any recommendation on how to unit test these kind of methods?
Unfortunately, no. I would just test rendering by comparing screenshots and gbuffers.
Question
Any tips on how to properly mock classes of LWJGL? For example when I try to static mock the GL11 class, it results in a
class redefinition failed, invalid class
error.Reproduction of issue (Available here on GitHub):
$ mvn archetype:generate -DgroupId=com.example -DartifactId=gl11test
21
inpom.xml
:pom.xml
:src/test/java/com/example/JWJGLTest.java
:$ mvn clean test
Error:
Any idea what could be wrong?