@Test void testContextRootOverrideByConfig() { JaxRsApplication app = JaxRsApplication.create(TestApp.class); Optional<String> contextRoot = extension.findContextRoot(EMPTY_CONFIG, app); assertThat(contextRoot, value(is("/wrong"))); Config config = Config .create(ConfigSources.create(Map.of(TestApp.class.getName() + "." + RoutingPath.CONFIG_KEY_PATH, "config"))); contextRoot = extension.findContextRoot(config, app); assertThat(contextRoot, value(is("/config"))); }
Optional<String> findContextRoot(io.helidon.config.Config config, JaxRsApplication jaxRsApplication) { return config.get(jaxRsApplication.appClassName() + "." + RoutingPath.CONFIG_KEY_PATH) .asString() .or(jaxRsApplication::contextRoot) .map(path -> (path.startsWith("/") ? path : ("/" + path))); }
JaxRsCdiExtension implements Extension { Optional<String> findContextRoot(io.helidon.config.Config config, JaxRsApplication jaxRsApplication) { return config.get(jaxRsApplication.appClassName() + "." + RoutingPath.CONFIG_KEY_PATH) .asString() .or(jaxRsApplication::contextRoot) .map(path -> (path.startsWith("/") ? path : ("/" + path))); } }
JaxRsCdiExtension implements Extension { Optional<String> findContextRoot(io.helidon.config.Config config, JaxRsApplication jaxRsApplication) { return config.get(jaxRsApplication.appClassName() + "." + RoutingPath.CONFIG_KEY_PATH) .asString() .or(jaxRsApplication::contextRoot) .map(path -> (path.startsWith("/") ? path : ("/" + path))); }  }
JaxRsCdiExtension implements Extension { Optional<String> findContextRoot(io.helidon.config.Config config, JaxRsApplication jaxRsApplication) { return config.get(jaxRsApplication.appClassName() + "." + RoutingPath.CONFIG_KEY_PATH) .asString() .or(jaxRsApplication::contextRoot) .map(path -> (path.startsWith("/") ? path : ("/" + path))); }  List<JaxRsApplication> applicationsToRun(); void removeApplications(); void removeResourceClasses(); void addResourceClasses(List<Class<?>> resourceClasses); void addApplications(List<JaxRsApplication> applications); void addApplication(Application application); void addApplication(String contextRoot, Application application); String serviceName(); void addSyntheticApplication(List<Class<?>> resourceClasses); }
JaxRsCdiExtension implements Extension { Optional<String> findContextRoot(io.helidon.config.Config config, JaxRsApplication jaxRsApplication) { return config.get(jaxRsApplication.appClassName() + "." + RoutingPath.CONFIG_KEY_PATH) .asString() .or(jaxRsApplication::contextRoot) .map(path -> (path.startsWith("/") ? path : ("/" + path))); }  List<JaxRsApplication> applicationsToRun(); void removeApplications(); void removeResourceClasses(); void addResourceClasses(List<Class<?>> resourceClasses); void addApplications(List<JaxRsApplication> applications); void addApplication(Application application); void addApplication(String contextRoot, Application application); String serviceName(); void addSyntheticApplication(List<Class<?>> resourceClasses);  }