growthbook / growthbook-sdk-java

The Java SDK for GrowthBook (JVM, Android)
https://docs.growthbook.io/lib/java
MIT License
7 stars 10 forks source link

JSON serialization & deserialization, GrowthBook utils (hash, inNameSpace), Java docs publish, more types #6

Closed tinahollygb closed 1 year ago

tinahollygb commented 1 year ago

Unit Testing

Test cases JSON

Adds the test cases JSON that other SDK's use so we can have a consistent level of confidence in all the SDK's. The version copied was the latest on main from the JavaScript SDK as of this morning.

Mocking

Adds support for mocking in unit tests with Mockito. See Context tests for a simple example.

Test Coverage

Adds test coverage reporting with Jacoco. Right now only the HTML reporter appears to be output but we can configure other formats, which may be useful if we want to enforce a minimum test coverage.

image image

JSON serialization and deserialization

Adds a util class GrowthBookJsonUtils for helping with serializing and deserializing namespaces from the tuple shape that is in the example JSON.

GrowthBookUtils

Adds some of the util classes:

See details in the Java doc.

These utils are tested against the above-mentioned test cases.

Java Doc

Since Java developers are accustomed to being able to access Java docs online, I've added a Github Action that publishes the Java docs to Github Pages: https://growthbook.github.io/growthbook-sdk-java

image image

Additional types/classes

Adds some more classes, e.g. FeatureRule, FeatureResult, FeatureResultSource, TrackingCallback, TrackingResult, support for forced variations Map on the Context including a ForcedVariationsHashMap class,