Update library to use Phaxio API to use v2.1 - #23
Merged
Merged
Conversation
noelherrick
commented
Aug 3, 2018
| @@ -1,10 +1,10 @@ | |||
| package com.phaxio.restclient; | |||
|
|
|||
| public class BasicAuthentication { | |||
Collaborator
Author
There was a problem hiding this comment.
HTTP calls this Authorization, not Authentication.
noelherrick
commented
Aug 3, 2018
| dos.flush(); | ||
| dos.close(); | ||
| } else { | ||
| } else if (!request.parameters.isEmpty()) { |
Collaborator
Author
There was a problem hiding this comment.
We were always sending at least the authorization parameters, so this client never had to deal with an empty body. This allows that.
noelherrick
commented
Aug 3, 2018
| String json = Responses.json("/account_status.json"); | ||
|
|
||
| stubFor(get(urlEqualTo("/v2/account/status?api_secret=SECRET&api_key=KEY")) | ||
| stubFor(get(urlEqualTo("/ver/account/status")) |
Collaborator
Author
There was a problem hiding this comment.
Since the version string isn't really important, I'm just faking it with the placeholder ver which would allow us to change versions but not update all these places in the tests.
noelherrick
force-pushed
the
22-update-to-api-2-1
branch
from
August 3, 2018 11:49
3684280 to
500e555
Compare
Phaxio has released a new API, so we need to update this client library to support those changes. There are three major updates: a new endpoint, removing parameters from the fax callback, and moving to HTTP Basic Authorization. 1) We're going to use a new endpoint for the library (a different version string). Only the tests needed to be rewritten for this change besides changing the String in the Phaxio class. 2) The callback example project needed to remove `success`, `is_test`, and `direction` from the expected parameters. 3) We needed to move to HTTP Basic Authorization. The RestClient accomodated this change, but called it Authentication, so I renamed the classes/methods from using the word authentication to authorization, and then changed the Phaxio class to use basic auth on the RestClient. This necessitated a bunch of changes to the tests that mocked the HTTP endpoints which is the majority of the lines in this commit. Finally, a couple of minor changes: a previous PR didn't space parameters in method signatures and calls, so there are a few lines that just adding spaces. Secondly, barcodes (an list of objects) and callerName (a String) were added the Fax objects in the client and the example project.
noelherrick
force-pushed
the
22-update-to-api-2-1
branch
from
August 10, 2018 10:01
500e555 to
acca6b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phaxio has released a new API, so we need to update this client library to support those changes. There are three major updates: a new endpoint, removing parameters from the fax callback, and moving to HTTP Basic Authorization.
We're going to use a new endpoint for the library (a different version string). Only the tests needed to be rewritten for this change besides changing the String in the Phaxio class.
The callback example project needed to remove
success,is_test, anddirectionfrom the expected parameters.We needed to move to HTTP Basic Authorization. The RestClient accommodated this change, but called it Authentication, so I renamed the classes/methods from using the word authentication to authorization, and then changed the Phaxio class to use basic auth on the RestClient. This necessitated a bunch of changes to the tests that mocked the HTTP endpoints which is the majority of the lines in this commit.
Finally, a couple of minor changes: a previous PR didn't space parameters in method signatures and calls, so there are a few lines that just adding spaces. Secondly, barcodes (an array of ints) and callerName (a String) were added the Fax objects in the client and the example project.
Closes #22