Code example for InputStreamReader

	// test to see that we read and convert config correctly 
	public void testPhysicalSourceConfig() throws IOException { 
		ObjectMapper mapper = new ObjectMapper();
		InputStreamReader isr = new InputStreamReader(IOUtils.toInputStream(_configSource));
		//PhysicalSourceConfig physicalSourceConfig = mapper.readValue(sourcesJson, PhysicalSourceConfig.class); 
		PhysicalSourceConfig physicalSourceConfig = mapper.readValue(isr, PhysicalSourceConfig.class);
		PhysicalSourceStaticConfig pStatic=null;
		try { 
		  pStatic =;
		} catch (InvalidConfigException e) {
		  fail("PhysicalSourceConfig.checkForNulls failed.", e);
		// also assert basic stuff 
		assertNotNull("Uri is null.", pStatic.getUri());
		assertNotNull("Name is null.", pStatic.getName());
Contextual code suggestions in your IDE  Get Codota for Java