Skip to content
New issue

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

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

Already on GitHub? # to your account

Error generating code using Map #35

Open
tfdsimoes opened this issue Nov 19, 2023 · 0 comments
Open

Error generating code using Map #35

tfdsimoes opened this issue Nov 19, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@tfdsimoes
Copy link
Collaborator

Giving the following code

@PactDslBodyBuilder
public class DemoClass {

    private Map<String, String> aMap1;
}

It generates

public class DemoClassBuilder {
        java.util.Map<java.lang.String,java.lang.String> aMap1 = List.of("O99o0v");

;

  public DemoClassBuilder setAMap1(final java.util.Map<java.lang.String,java.lang.String> aMap1) {
    this.aMap1 = aMap1;
    return this;
  }

    public DslPart build() {
        PactDslJsonBody pactDslJsonBody = new PactDslJsonBody();
    pactDslJsonBody.eachLike("aMap1",   PactDslJsonRootValue
          .stringType("RL3xuvc1he")
          .stringType("O99o0v")
, 1);


        return pactDslJsonBody;
    }

    private static void applyCustomModifiers(PactDslJsonBody pactDslJsonBody) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
    }
}

Should be a Map.of instead of List.of

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

No branches or pull requests

2 participants