- @Test
- public void getFileContents() {
- File file = new File(getClass().getClassLoader().getResource("configHelperTest.properties").getFile());
- try {
- assertNotNull(ConfigHelper.getFileContents(file.getAbsolutePath()));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- @Test
- public void loadConfig() throws Exception {
- String separator = FileSystems.getDefault().getSeparator();
- assertEquals(3, ConfigHelper.loadConfig("target"+separator+"test-classes"+separator+"configHelperTest.properties").size());
- }
-
- @Test
- public void propertyFetch() throws Exception {
- Properties p=new Properties();
- p.setProperty("key1","value1");
- assertEquals(ConfigHelper.propertyFetch(p,"key1","value2"),"value1");
- assertEquals(ConfigHelper.propertyFetch(p,"key2","value2"),"value2");
- }