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

ByteBudyImposterizer fails to mock scala case classes #180

Closed
laurynaslubys opened this issue Apr 22, 2020 · 1 comment
Closed

ByteBudyImposterizer fails to mock scala case classes #180

laurynaslubys opened this issue Apr 22, 2020 · 1 comment
Milestone

Comments

@laurynaslubys
Copy link
Contributor

It seems, that the ByteBuddy imposterizer is too strict when mocking classes. We have the following situation:

  1. a scala case class has a field annotated with @JsonIgnore
  2. the scala compiler adds this annotation to the parameter corresponding with the field in the scala generated copy method
  3. ByteBuddy type validation fails, because @JsonIngore is not marked as being valid for parameters

I believe that JMock should not validate the generated class as the validation is too strict and if the source class is not strictly valid according to ByteBuddy, it's impossible to mock such a class at all.

What are your thoughts?

I'll submit a PR shortly

@laurynaslubys laurynaslubys changed the title ClassImposterizer fails to mock scala case classes ByteBudyImposterizer fails to mock scala case classes Apr 22, 2020
@olibye olibye added this to the 2.13 milestone Mar 12, 2024
@olibye
Copy link
Member

olibye commented Mar 12, 2024

fixed by #181

@olibye olibye closed this as completed Mar 12, 2024
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

No branches or pull requests

2 participants