Skip to content

HamsterGameResolver broken for inherited test methods

If you have a base class which needs its parameter injected the following code fails: final HamsterTest hamsterTest = parameterContext.getDeclaringExecutable().getDeclaringClass().getAnnotation(HamsterTest.class);

The problem is that the declaringClass in this case is the base class but the annotation is on the child class...

An example is in https://github.com/SQA-PSE-WS2020/exercise-sheet-6-Test/tree/fix/test-homework

There I worked around the issue by overriding the method which requires parameter injection again in the sub class just to call super again.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information