### Question:
Parser { public Configuration parse(String bucket, String key) throws IOException { S3Object s3object = new AmazonS3Client().getObject(new GetObjectRequest(bucket, key)); return parse(s3object.getObjectContent()); }  Configuration parse(String bucket, String key); Configuration parse(InputStream resource);  }### Answer:
@Test public void testParse() throws Exception { Parser parser = new Parser(); Configuration configuration = parser.parse(getClass().getResourceAsStream("configparser.json")); assertEquals(2, configuration.getMappings().size()); assertEquals("parser-stage", configuration.getDestinationBucket()); assertEquals("parser-raw", configuration.getSourceBucket()); assertEquals("parserfile1.csv", configuration.getMappings().get(0).getSourceFiles().get(0)); assertEquals("sql-bucket", configuration.getSqlBucket()); assertEquals("sql1.sql", configuration.getMappings().get(0).getSqlFile()); assertEquals("file", configuration.getFileSystem()); assertEquals("file1.csv", configuration.getMappings().get(1).getSourceFiles().get(0)); assertEquals("file2.csv", configuration.getMappings().get(1).getSourceFiles().get(1)); assertEquals("sql2.sql", configuration.getMappings().get(1).getSqlFile()); }