Skip to content

Added fromjson test and method for carmen feature - #279

Merged
cammace merged 2 commits into
masterfrom
cam-carmen-test
Jan 17, 2017
Merged

Added fromjson test and method for carmen feature#279
cammace merged 2 commits into
masterfrom
cam-carmen-test

Conversation

@cammace

@cammace cammace commented Jan 17, 2017

Copy link
Copy Markdown

Closes: #278

Carmen Feature was using the fromJson() method found in the Feature.class. This method was returning a Feature object and not a Carmen. To get around this, I added a fromJson method to Carmen Feature.

@mention-bot

Copy link
Copy Markdown

@cammace, thanks for your PR! By analyzing the history of the files in this pull request, we identified @zugaldia to be a potential reviewer.

@cammace cammace self-assigned this Jan 17, 2017
* @since 2.0.0
*/
public static CarmenFeature fromJson(String json) {
GsonBuilder gson = new GsonBuilder();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@cammace Don't you need to attach our custom deserializer here gson.registerTypeAdapter(Position.class, new PositionDeserializer());?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good point, need to make my test more robust to catch this also.

@cammace
cammace merged commit 7af5094 into master Jan 17, 2017
@cammace
cammace deleted the cam-carmen-test branch January 17, 2017 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants