Code example for Gson

Methods: fromJson

0
	/** 
	 * Verify repository with no generated id 
	 */ 
	@Test 
	public void noGeneratedId() { 
		SearchRepository repo = gson.fromJson("{}", SearchRepository.class);
		assertNull(repo.generateId());
		repo = gson.fromJson("{name:\"\", owner:\"use\"}",
				SearchRepository.class); 
		assertNull(repo.generateId());
		repo = gson.fromJson("{owner:\"\"}", SearchRepository.class);
		assertNull(repo.generateId());
	} 
 
	/** 
	 * Test non-mutable created at date 
	 */ 
	@Test 
	public void getCreatedAtReferenceMutableObject() { 
		SearchRepository repository = gson.fromJson(