• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-java / #16493

03 Oct 2024 07:15PM UTC coverage: 12.942% (+0.08%) from 12.864%
#16493

push

github

web-flow
Merge Stripe-java v27.0.0 to beta branch (#1888)

409 of 1651 new or added lines in 88 files covered. (24.77%)

31 existing lines in 7 files now uncovered.

18773 of 145050 relevant lines covered (12.94%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/src/main/java/com/stripe/net/JsonEncoder.java
1
package com.stripe.net;
2

3
import com.google.gson.FieldNamingPolicy;
4
import com.google.gson.Gson;
5
import com.google.gson.GsonBuilder;
6
import java.io.IOException;
7
import java.util.HashMap;
8
import java.util.Map;
9

NEW
10
final class JsonEncoder {
×
11
  private static final Gson BODY_GSON =
1✔
12
      new GsonBuilder()
13
          .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
1✔
14
          .serializeNulls()
1✔
15
          .create();
1✔
16

17
  public static HttpContent createHttpContent(Map<String, Object> params) throws IOException {
18
    if (params == null) {
1✔
19
      params = new HashMap<String, Object>();
1✔
20
    }
21
    return HttpContent.buildJsonContent(BODY_GSON.toJson(params));
1✔
22
  }
23
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc