dgs-codegen
dgs-codegen copied to clipboard
Add integration test suite for Java code generator
Use the same approach as for Kotlin2CodeGenTest with a few differences:
- Test cases are grouped by topic/area, so that it is easier to run just the required subset of related test cases.
- Test case for underscore fields, which was inlined into
Kotlin2CodeGenTest, is added as a separate test case into themiscpackage.
Use com.netflix.graphql.dgs.codegen.java package for the test cases to avoid any accidental name clashes with the classes from the integration test suite for Kotlin code generator.
Refactor the parametrized test logic, so that it works with the paths relative to the test sources root directory, rather than relying only on the parent package/directory.
Resolve the issue with the client API generation for the cases when a reserved keyword is used as an input field name. Sanitize the input variable name, so that the generated Java code can be compiled.