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

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

@apenlor apenlor added the bug Something isn't working label Nov 20, 2023
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
Development

No branches or pull requests

2 participants