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(smartcar): Get & Set Charge Limit #130

Closed EvanPeterson1324 closed 1 year ago

EvanPeterson1324 commented 1 year ago

Overview

Adds one new data type VehicleChargeLimit with two new methods, getChargeLimit() and setChargeLimit(double limit)

Asana: https://app.asana.com/0/1204073873904879/1204302264096976/f

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #130 (cd69cf8) into master (3fc1800) will increase coverage by 0.06%. The diff coverage is 85.71%.

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/smartcar/java-sdk/pull/130/graphs/tree.svg?width=650&height=150&src=pr&token=nZAITx7w3X&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar)](https://codecov.io/gh/smartcar/java-sdk/pull/130?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar) ```diff @@ Coverage Diff @@ ## master #130 +/- ## ============================================ + Coverage 78.35% 78.41% +0.06% - Complexity 205 209 +4 ============================================ Files 37 38 +1 Lines 827 834 +7 Branches 58 58 ============================================ + Hits 648 654 +6 - Misses 147 148 +1 Partials 32 32 ``` | Flag | Coverage Δ | | |---|---|---| | integration | `65.34% <71.42%> (+0.05%)` | :arrow_up: | | test | `51.55% <85.71%> (+0.28%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/smartcar/java-sdk/pull/130?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar) | Coverage Δ | | |---|---|---| | [...c/main/java/com/smartcar/sdk/data/VehicleFuel.java](https://codecov.io/gh/smartcar/java-sdk/pull/130?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#diff-c3JjL21haW4vamF2YS9jb20vc21hcnRjYXIvc2RrL2RhdGEvVmVoaWNsZUZ1ZWwuamF2YQ==) | `80.00% <ø> (ø)` | | | [...java/com/smartcar/sdk/data/VehicleChargeLimit.java](https://codecov.io/gh/smartcar/java-sdk/pull/130?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#diff-c3JjL21haW4vamF2YS9jb20vc21hcnRjYXIvc2RrL2RhdGEvVmVoaWNsZUNoYXJnZUxpbWl0LmphdmE=) | `66.66% <66.66%> (ø)` | | | [src/main/java/com/smartcar/sdk/Vehicle.java](https://codecov.io/gh/smartcar/java-sdk/pull/130?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar#diff-c3JjL21haW4vamF2YS9jb20vc21hcnRjYXIvc2RrL1ZlaGljbGUuamF2YQ==) | `96.00% <100.00%> (+0.13%)` | :arrow_up: | ------ [Continue to review full report in Codecov by Sentry](https://codecov.io/gh/smartcar/java-sdk/pull/130?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/smartcar/java-sdk/pull/130?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar). Last update [3fc1800...cd69cf8](https://codecov.io/gh/smartcar/java-sdk/pull/130?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=smartcar).
s-ashwinkumar commented 1 year ago

@EvanPeterson1324 The tests are working now. I dont know how this changed but there was no redirect URI in the configs . That said, there is still something you might have to look into in code. This is the current failure logs : https://app.travis-ci.com/github/smartcar/java-sdk/jobs/599949031 If you scroll down to find the issue you will see this

> Task :compileTestJava FAILED
/home/travis/build/smartcar/java-sdk/src/test/java/com/smartcar/sdk/VehicleTest.java:223: error: unexpected type
    Assert.assertTrue(chargeLimit.getChargeLimit() instanceof Double);
                                                ^
  required: reference
  found:    double
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

Points to a code issue that we introduced.

EvanPeterson1324 commented 1 year ago

@EvanPeterson1324 The tests are working now. I dont know how this changed but there was no redirect URI in the configs . That said, there is still something you might have to look into in code. This is the current failure logs : https://app.travis-ci.com/github/smartcar/java-sdk/jobs/599949031 If you scroll down to find the issue you will see this

> Task :compileTestJava FAILED
/home/travis/build/smartcar/java-sdk/src/test/java/com/smartcar/sdk/VehicleTest.java:223: error: unexpected type
    Assert.assertTrue(chargeLimit.getChargeLimit() instanceof Double);
                                                ^
  required: reference
  found:    double
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

Points to a code issue that we introduced.

I fixed the above issue :+1: I needed to wrap the primitive double with the Double constructor for it to check properly with instanceof