OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.44k stars 6.48k forks source link

[test-stack] Implement inner class assertion and fix typo "doesNotContains" #18921

Closed Philzen closed 3 months ago

Philzen commented 3 months ago

After some hours of wrestling Generics, this finally works as intended and mainly adds the following:

Also did changes to harmonize and improve our JavaFileAssert API:

In general, there is more about this API that should be harmonized, but for starters i'm happy.

PR checklist

Philzen commented 3 months ago

@wing328 Kindly take a gander. Please merge before #18917 as it builds on the features that are introduced here.

Doing separate PRs as i want to start more clearly separating scope / concerns here, makes things easier in case anything comes up and a revert should be needed.

I was temped to press the merge button myself as i'm confident this PR is a non-critical feature addition to the test stack … however i don't want to take liberties here…

wing328 commented 3 months ago

can you please resolve the merge conflicts when you've time? after that i'll get it merged.

Philzen commented 3 months ago

can you please resolve the merge conflicts when you've time? after that i'll get it merged.

Done!

Actually that merge conflict was a stroke of luck b/c i realized the API i introduced did not have the consistency i intended when i tried to apply the added hasAnnotation() short-hand method to the tests that were just merged in #18870 … now it's really beautiful, just look at https://github.com/OpenAPITools/openapi-generator/pull/18921/commits/6af0eaef028cb2fe0f7133250225286fde89b1f3

As part of that, i also harmonized the inconsistency between assert… and has…. Now assert… will always return a assertion object (going deeper), while has… gives back the same (staying on the same level). Writing tests is slowly becoming even more fun :smile:

Updated the PR description and rebased #18917 on this, so that should go through easily.