ConfigMapper { public boolean validatePropertyPath(final PropertyPath fullPath) { return propertyMap.get(fullPath) != null; } @Inject  ConfigMapper(final AppConfig appConfig); static void decorateWithPropertyPaths(final AppConfig appConfig); boolean validatePropertyPath(final PropertyPath fullPath); Optional<Prop> getProp(final PropertyPath propertyPath); static final String LIST_EXAMPLE; static final String MAP_EXAMPLE; static final String DOCREF_EXAMPLE; }
@Test void testValidatePropertyPath_valid() { AppConfig appConfig = new AppConfig(); ConfigMapper configMapper = new ConfigMapper(appConfig); boolean isValid = configMapper.validatePropertyPath(PropertyPath.fromPathString("stroom.ui.aboutHtml")); assertThat(isValid).isTrue(); }
@Test void testValidatePropertyPath_invalid() { AppConfig appConfig = new AppConfig(); ConfigMapper configMapper = new ConfigMapper(appConfig); boolean isValid = configMapper.validatePropertyPath(PropertyPath.fromPathString("stroom.unknown.prop")); assertThat(isValid).isFalse(); }