Skip to content

Type registration ignores NullInjectGenerator #1232

@adambridger

Description

@adambridger

Describe the bug

When type registration is used in conjunction with NullInjectGenerator, the NullInjectGenerator value is ignored.

Your environment

  • 1.1.14
  • Java

Steps to reproduce

     FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
            .register(String.class, fm ->
                    fm.giveMeBuilder(String.class)
                            .set("$", "Default String")
            )
            .pushNullInjectGenerator(MatcherOperator.exactTypeMatchOperator(String.class, (context) -> ALWAYS_NULL_INJECT))
            .build();

    String str = fixtureMonkey.giveMeOne(String.class);
    System.out.println("str = " + str);

Expected behaviour

Generated String should be null per NullInjectGenerator for String.class

Actual behaviour

Generated String is never null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions