Skip to content

Instantly share code, notes, and snippets.

@shuji
Created June 1, 2013 04:47
Show Gist options
  • Save shuji/5689298 to your computer and use it in GitHub Desktop.
Save shuji/5689298 to your computer and use it in GitHub Desktop.
1. 書籍クラスを作り、toJsonメソッドのユニットテストを作成する
書籍データ
isdn: 477415377X
title: JUnit実践入門
author: 渡辺修司
toJson
{"isdn":"477415377X","title":"JUnit実践入門","author":"渡辺修司"}
2.外部APIを利用し、書籍情報を取得するメソッド(findByIsbn)を作成し、ユニットテストを作成する
外部API
http://booksearchapi/json?isbn=477415377X
{"result": "success", "data": {"title": "JUnit実践入門", "author": "渡辺修司" }}
http://booksearchapi/json?isbn=000
{"result": "not_found"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment