/******************************************************************************************************************* * * FIXME: move to ResourceProperties! * ******************************************************************************************************************/ private void logProperties (final @Nonnull String indent, final @Nonnull ResourceProperties properties) { log.debug("{} property items:", indent); for (final Key<?> key : properties.getKeys()) { try { log.debug("{}>>>> {} = {}", indent, key, properties.getProperty(key)); } catch (NotFoundException | IOException e) { log.error("", e); } } log.debug("{} property groups: {}", indent, properties.getGroupIds()); for (final Id groupId : properties.getGroupIds()) { log.debug("{}>>>> group: {}", indent, groupId); logProperties(indent + ">>>>", properties.getGroup(groupId)); } } }
/******************************************************************************************************************* * ******************************************************************************************************************/ @BeforeMethod public void setup() throws Exception { context = new ClassPathXmlApplicationContext("DefaultMetadataTestBeans.xml"); context.getBean(MetadataInterpolatorFactory.class); // initialize it properties = mock(ResourceProperties.class); final ResourceProperties resourceProperties = mock(ResourceProperties.class); when(resourceProperties.getProperty(PROPERTY_LENS_IDS)).thenReturn(Arrays.asList("1:Lens1", "2:Lens2")); when(properties.getGroup(PROPERTY_GROUP_ID)).thenReturn(resourceProperties); }
final SiteNode rootSiteNode = site.find(SiteNode).withRelativeUri("/").result(); final ResourceProperties rootSiteNodeProperties = rootSiteNode.getProperties(); final ResourceProperties properties = rootSiteNodeProperties.getGroup(PROPERTY_GROUP_ID);