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

Infinite Recursion #1099

Open
esfomeado opened this issue Nov 20, 2024 · 1 comment
Open

Infinite Recursion #1099

esfomeado opened this issue Nov 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@esfomeado
Copy link
Contributor

Describe the bug

I have a class that contains a protobuf Message.

Fixture Monkey is not able to generate this type out of the box which is fine.

I´ve tried ignoring that field, added the package to the exclusion list, added an arbitrary generator but nothing stopped Fixture Monkey from going into a infinite recursion.

Your environment

Fixture Monkey 1.1.3
Java 21

Steps to reproduce

https://github.com/esfomeado/fixture-monkey-bug/blob/master/src/test/java/com/example/bug/FixtureMonkeyTest.java#L212

Expected behaviour

It should stop trying to generate the field

Actual behaviour

It never stops

@esfomeado esfomeado added the bug Something isn't working label Nov 20, 2024
@seongahjo
Copy link
Contributor

seongahjo commented Nov 22, 2024

@esfomeado
Hello

It is due to the option useAnonymousArbitraryIntrospector, it generates the getters of interface.

It will be fixed in 1.2.0 for backward compatibility, until then you can use the option below.

fixtureMonkeyBuilder.pushPropertyGenerator(
    new MatcherOperator<>(
        p -> Modifier.isInterface(Types.getActualType(p.getType()).getModifiers()),
        p -> Collections.emptyList()
    )
)

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants