Added unit test for JSON serialization