DefaultPropertyManager extends PropertyManager { public Optional<String> get(String name) { try { Object object = config.getAnyRef(name).toString(); if (object == null) { return Optional.absent(); } else { return Optional.of(object.toString()); } } catch (Exception e) { return Optional.absent(); } } DefaultPropertyManager();  DefaultPropertyManager(File file); Optional<String> get(String name); List<Bean> list(Schema schema, Map<String, Schema> schemas); static final String PROPERTY_FILE_PROPERTY; }
@Test public void test_regular_property() { Optional<String> value = properties.get(SINGLE_PROPERTY_NAME); Assert.assertTrue(value.isPresent()); Assert.assertThat(value.get(), Is.is(SINGLE_PROPERTY_VALUE)); }
@Test public void test_get_singleton_beanid() { Optional<Bean> bean = properties.get(BeanId.createSingleton(SINGLETON_SCHEMA), schemas); Assert.assertTrue(bean.isPresent()); assertBean(bean.get()); }
@Test public void test_get_instance_beanid() { Optional<Bean> bean = properties.get(BeanId.create("1", INSTANCES_SCHEMA), schemas); Assert.assertTrue(bean.isPresent()); assertBean(bean.get()); bean = properties.get(BeanId.create("2", INSTANCES_SCHEMA), schemas); Assert.assertTrue(bean.isPresent()); assertBean(bean.get()); }