### Question:
FileMappingsProvider extends AbstractMappingsProvider { @Override public Map<Integer, String> getMappings() { logger.debug("Processing: "); try { return parseMappings(acquire()); } catch (NumberFormatException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } } FileMappingsProvider(String filename); @Override Map<Integer, String> getMappings(); @Override BufferedReader acquire();  }### Answer:
@Test public void testLoadMappingsFile() throws FileNotFoundException, IOException { FileMappingsProvider fileHandler = new FileMappingsProvider("src/test/resources/mappings.conf.good"); Map<Integer, String> mappings = fileHandler.getMappings(); assertTrue(mappings != null); assertNotNull(mappings.get(8080)); assertNull(mappings.get(8081)); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testLoadBadMappingsFilePath() throws FileNotFoundException, IOException { new FileMappingsProvider("src/test/resources/mappings.conf.bad.path").getMappings(); }
@Test(expectedExceptions = RuntimeException.class) public void testLoadBadMappingsFilePort() throws FileNotFoundException, IOException { new FileMappingsProvider("src/test/resources/mappings.conf.bad.port").getMappings(); }