Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop Gson exposure by making MastodonClient.getSerializer internal #86

Merged
merged 1 commit into from
Jan 5, 2023

Conversation

bocops
Copy link
Collaborator

@bocops bocops commented Jan 5, 2023

This closes #51.

There are some weird things going on that I want to mention here:

  • mocking an otherwise inaccessible function via dynamic call in the MockClient for bigbone-rx. This might be a sign of either a badly designed test, or other structural issues.
  • creating separate Gson() instances directly in our samples. This should typically not be done, but those samples use undocumented functionality and need to be rewritten anyway.

Neither is really great, but we shouldn't keep MastodonClient.getSerializer() public only to keep tests and outdated samples working.

I also had to use @PublishedApi on the now internal function. That means that the function is "technically exposed in bytecode" but not able to be called directly from outside the module. I assume this is OK.

@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Merging #86 (c9e77c6) into master (ae9691f) will not change coverage.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #86   +/-   ##
=========================================
  Coverage     41.72%   41.72%           
  Complexity      167      167           
=========================================
  Files            62       62           
  Lines          1383     1383           
  Branches         82       82           
=========================================
  Hits            577      577           
  Misses          785      785           
  Partials         21       21           
Impacted Files Coverage Δ
...e/src/main/kotlin/social/bigbone/MastodonClient.kt 10.13% <0.00%> (ø)

Copy link
Owner

@andregasser andregasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good for me. Good to have getSerializer() no longer exposed to library users.

@andregasser andregasser merged commit 78c701b into andregasser:master Jan 5, 2023
@bocops bocops deleted the 51_stop_gson_exposure branch January 5, 2023 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move Gson serialization into MastodonClient
2 participants