@Test
public void testToJson() throws IOException
{

	inMemoryProvider.addMapping("app0", "user0.0", "pentaho0");
	inMemoryProvider.addMapping("app0", "user0.1", "pentaho1");
	inMemoryProvider.addMapping("app0", "user0.2", "pentaho2");
	inMemoryProvider.addMapping("app1", "user0.0", "pentaho3");
	inMemoryProvider.addMapping("app1", "user0.1", "pentaho4");
	String json = inMemoryProvider.toJson();
	System.out.println(json);
	ObjectMapper mapper = new ObjectMapper();
	Object result = mapper.readValue(json, new TypeReference <Map<String, ApplicationMappings>>()
	{
	});
	assertNotNull(result);
	@SuppressWarnings("unchecked")
	Map<String, ApplicationMappings> maps = (Map<String, ApplicationMappings>) result;
	InMemoryUsernameProvider checkProvider = new InMemoryUsernameProvider();
	checkProvider.setApplicationsMap(maps);
	
	String pentahoUser = checkProvider.getUsername("app0", "user0.0");
	assertNotNull(pentahoUser);
	assertEquals("pentaho0", pentahoUser);
	
	pentahoUser = checkProvider.getUsername("app1", "user0.1");
	assertNotNull(pentahoUser);
	assertEquals("pentaho4", pentahoUser);
}