Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for @TestTarget annotation for junit tests written in scala #1460

Conversation

psliwa
Copy link
Contributor

@psliwa psliwa commented Oct 4, 2021

When junit test is written in scala @TestTarget annotation attached to val doesn't work because of:

java.lang.IllegalAccessException: class kotlin.reflect.jvm.internal.calls.CallerImpl$FieldGetter cannot access a member of class au.com.dius.pact.provider.junit.ScalaJunitTest with modifiers "private final"

In scala if you define class member by val x it will be represented in bytecode by private field x and public getter method x(). Because of this implementation detail it is not possible to use @TestTarget annotation on scala's val x = ... class member.

@uglyog uglyog merged commit 6da8007 into pact-foundation:master Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants