Azure / autorest.java

Extension for AutoRest (https://github.com/Azure/autorest) that generates Java code
MIT License
33 stars 82 forks source link

Migrate all tests to JUnit 5 #2809

Closed alzimmermsft closed 3 months ago

alzimmermsft commented 3 months ago

Fixes #1253

Migrate tests to JUnit 5, as part of this migration it was realized many tests weren't running due to them using JUnit 4 configurations but the vintage JUnit engine wasn't included so they weren't being ran. As part of migrating to JUnit 5 they began running again and a few errors in code generation were found.

And some cases of code generation disabled stream-style serialization as they were testing Jackson annotation cases with JSON flattening.

Some tests were disabled due to either incorrect behavior with Java object types and disallowed null values (this won't throw as boxed typed are allowed to be null and there is no logic generated to prevent this) and direct usage of enum types in serialization as stream-style falls back to Jackson for non-JsonSerializable and non-XmlSerializable scenarios and enums are handled as their name and not toString value by default.