### Question:
SystemPropertiesService implements SystemPropertiesServiceMBean { public SystemPropertiesService load() { try { load(configPath); } catch (IOException e) { e.printStackTrace(); } return this; } SystemPropertiesService(); String getConfigPath(); @Override String getSystemProperty(String name); @Override Properties getSystemProperties(); SystemPropertiesService load();  }### Answer:
@Test public void loadsResourceConfigFile() { new SystemPropertiesService().load(); String abiquoVersion = System.getProperty("abiquo.version"); assertNotNull(abiquoVersion); }
@Test public void loadSystemFile() throws Exception { File config = new File("/tmp/config.properties"); config.createNewFile(); FileOutputStream stream = new FileOutputStream(config); stream.write("abiquo.version=666".getBytes()); System.setProperty("abiquo.config.path", config.getAbsolutePath()); new SystemPropertiesService().load(); String abiquoVersion = System.getProperty("abiquo.version"); assertEquals("666", abiquoVersion); }
@Test public void doesNotLoadSystemFileUnlessExist() { System.setProperty("abiquo.config.path", "/tmp/foooooo"); new SystemPropertiesService().load(); String abiquoVersion = System.getProperty("abiquo.version"); assertNotNull(abiquoVersion); }
@Test public void doesNotOverrideSystemProperties() { System.setProperty("abiquo.version", "12345"); new SystemPropertiesService().load(); String abiquoVersion = System.getProperty("abiquo.version"); assertEquals("12345", abiquoVersion); }