paypal / mocca

Mocca is a GraphQL client for JVM languages with the goal of being easy to use, flexible and modular.
MIT License
15 stars 14 forks source link

Fix serialization and deserialization issues and make sure client honors documentation #24

Closed fabiocarvalho777 closed 3 years ago

fabiocarvalho777 commented 3 years ago

There are enough unit and functional tests to assure most common Mocca client use cases behave as designed and documented. However, additional tests could be introduced to cover corner cases. Besides that, it is known that there are bugs if the request POJOs are complex, containing inner POJOs and/or lists of POJOs for example.

Requirements

  1. Add new tests (unit tests only) under mocca-client module covering all possible and documented corner cases when it comes to a client API definition.
  2. Fix any issue uncovered with the introduction of new tests, especially the serialization and deserialization ones, as they are known to exist.
  3. Make any small performance enhancement, if found when working on this issue
  4. Make end user documentation corrections if necessary
  5. Enhancing tests for features provided outside of mocca-client library is NOT in the scope of this issue.
  6. Open new issues if any bug is found outside of what is described in the scope of this issue

Important

This issue depends on #22

Test cases

First, create a new test sample class, named SuperComplexSampleType, by copying ComplexSampleType. Then modify SuperComplexSampleType to support the following test cases below.

  1. Add a List of Strings in SuperComplexSampleType
  2. Add a List of SuperComplexSampleType.ComplexField in SuperComplexSampleType
  3. Add a SuperComplexSampleType.ComplexField inside of SuperComplexSampleType.ComplexField
  4. Add a List of SuperComplexSampleType.ComplexField inside of SuperComplexSampleType.ComplexField

Second, make sure all types of GraphQL method parameters and return types document at 4.3 Writing a client API have test cases and are properly tested with unit tests.