PolicyModel { public boolean loadPolicies(String file) { boolean loaded = false; if (file == null) { LOG.warn("Cannot load policies. Provided file does not exist"); return loaded; } final File policies = new File(file); if (policies.exists() && policies.isFile() && (file.endsWith(".rdf") || file.endsWith(".xml"))) { try { this.readModel(new FileInputStream(file)); loaded = true; } catch (FileNotFoundException e) { LOG.error("An error occurred while loading the policies file {}: {}", file, e.getMessage()); } } else { LOG.warn("The provided file either does not exist or is not a valid rdf/xml file: {}", file); } return loaded; } PolicyModel(); boolean loadPolicies(String file); List<Objective> listAllObjectives(); void deleteAllObjectives();  }
@Test public void shouldLoadPolicies() throws Exception { PolicyModel policyModel = new PolicyModel(); boolean loaded = policyModel.loadPolicies("src/test/resources/policies/giberrish.txt"); Assert.assertFalse(loaded); loaded = policyModel.loadPolicies("src/test/resources/policies/bl_policies.rdf"); Assert.assertTrue(loaded); }