Code example for Gson

Methods: fromJson

0
	/** 
	 * Test non-mutable created at date 
	 */ 
	@Test 
	public void getCreatedAtReferenceMutableObject() { 
		SearchRepository repository = gson.fromJson(
				"{createdAt : '2003-10-10'}", SearchRepository.class); 
		repository.getCreatedAt().setTime(0);
		assertTrue(repository.getCreatedAt().getTime() != 0);
	} 
 
	/** 
	 * Test non-mutable pushed at date 
	 */ 
	@Test 
	public void getPushedAtReferenceMutableObject() { 
		SearchRepository repository = gson.fromJson(
				"{pushedAt : '2003-10-10'}", SearchRepository.class); 
		repository.getPushedAt().setTime(0);
		assertTrue(repository.getPushedAt().getTime() != 0);
Connect your IDE to all the code out there  Get Codota for Java