BootstrapProperties extends Properties { public boolean isPrimaryUrlAvailable() { return primaryUrl != null; } BootstrapProperties();  BootstrapProperties(String resourceName);  BootstrapProperties(Properties p); Long getProperty(String key, Long defaultValue); @Deprecated synchronized Adapter createAdapter(); InputStream getConfigurationStream(); String[] getConfigurationUrls(); @SuppressWarnings("deprecation") String findAdapterResource(); boolean isPrimaryUrlAvailable(); URLString getPrimaryUrl(); synchronized AdapterConfigManager getConfigManager(); void reconfigureLogging(); boolean isEnabled(String key); static boolean isEnabled(Properties p, String key);  }
@Test public void testIsPrimaryUrlAvailable() throws Exception { String adapterName = this.getClass().getSimpleName() + "." + testName.getMethodName(); Adapter adapter = new Adapter(); adapter.setUniqueId(testName.getMethodName()); File filename = TempFileUtils.createTrackedFile(testName.getMethodName(), null, adapter); DefaultMarshaller.getDefaultMarshaller().marshal(adapter, filename); BootstrapProperties boot = new BootstrapProperties(createTestSample()); boot.put("adapterConfigUrl.1", filename.toURI().toURL().toString()); assertNotNull(boot.findAdapterResource()); assertTrue(boot.isPrimaryUrlAvailable()); assertNotNull(boot.getPrimaryUrl()); boot = new BootstrapProperties(createTestSample()); boot.put("adapterConfigUrl.1", "file: boot.put("adapterConfigUrl.2", filename.toURI().toURL().toString()); assertNotNull(boot.findAdapterResource()); assertFalse(boot.isPrimaryUrlAvailable()); assertNull(boot.getPrimaryUrl()); }