smartcar / java-sdk

Java client SDK for the Smartcar API.
https://smartcar.github.io/java-sdk
MIT License
20 stars 20 forks source link

feat: add SmartcarVehicleRequest class/Builder to allow general purpose requests to api #100

Closed naomiperez closed 2 years ago

naomiperez commented 2 years ago

Add a new general purpose/BSE related object/method SmartcarVehicleRequest to allow making requests like so: SmartcarVehicleRequest req = new SmarcarVehicleRequest.Builder.method("GET").path("tesla/thermometer/outside").build(); Adds E2E tests for this class.

Test Plan: create an app with my Smartcar Developer account and make requests with this method once it's in staging/prod.

Asana: https://app.asana.com/0/1201332815308984/1201631034519423/f

codecov[bot] commented 2 years ago

Codecov Report

Merging #100 (1a34f5c) into master (8863aba) will increase coverage by 1.48%. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #100      +/-   ##
============================================
+ Coverage     77.93%   79.42%   +1.48%     
- Complexity      185      202      +17     
============================================
  Files            34       37       +3     
  Lines           716      797      +81     
  Branches         44       49       +5     
============================================
+ Hits            558      633      +75     
- Misses          132      137       +5     
- Partials         26       27       +1     
Flag Coverage Δ
integration 67.00% <ø> (+1.21%) :arrow_up:
test 51.44% <ø> (+4.09%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/main/java/com/smartcar/sdk/Smartcar.java 66.07% <ø> (ø)
.../java/com/smartcar/sdk/SmartcarVehicleRequest.java 91.48% <ø> (ø)
src/main/java/com/smartcar/sdk/Vehicle.java 97.45% <ø> (-1.46%) :arrow_down:
...in/java/com/smartcar/sdk/data/VehicleResponse.java 100.00% <ø> (ø)
...smartcar/sdk/data/VehicleResponseDeserializer.java 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8863aba...1a34f5c. Read the comment docs.

naomiperez commented 2 years ago

The Travis CI build is failing on the command test -z "$(git diff --name-only | grep 'docs/')". I think checks that the docs have changed since the last commit. I updated the docs locally with ./gradlew javadoc and pushed/commit them. It may be failing because there were not any updates to the docs between the last commit and the one previous. I'm not sure, so I'll ask in standup tomorrow.

Update: This command checks that the docs that Travis CI builds with the gradle task "javadoc" is the same as the ones you committed. My issue was that I was using Java 17 when I generated the docs, but I needed to use the version Travis uses, which is Java 8 because they generate docs differently.

naomiperez commented 2 years ago

Using branch "request" instead