use of com.yahoo.vespa.model.container.jersey.RestApiContext in project vespa by vespa-engine.
the class RestApiBuilder method createRestApiContext.
private RestApiContext createRestApiContext(AbstractConfigProducer ancestor, Element spec, String bindingPath) {
RestApiContext restApiContext = new RestApiContext(ancestor, bindingPath);
restApiContext.addBundles(getBundles(spec));
return restApiContext;
}
use of com.yahoo.vespa.model.container.jersey.RestApiContext in project vespa by vespa-engine.
the class MultipleRestApisTest method each_rest_api_has_correct_bundle.
@Test
public void each_rest_api_has_correct_bundle() {
RestApiContext restApiContext1 = restApis.get(ComponentId.fromString(PATH_1)).getContext();
RestApiContext restApiContext2 = restApis.get(ComponentId.fromString(PATH_2)).getContext();
JerseyBundlesConfig bundlesConfig1 = root.getConfig(JerseyBundlesConfig.class, restApiContext1.getConfigId());
assertThat(bundlesConfig1.toString(), containsString("bundle1"));
assertThat(bundlesConfig1.toString(), not(containsString("bundle2")));
JerseyBundlesConfig bundlesConfig2 = root.getConfig(JerseyBundlesConfig.class, restApiContext2.getConfigId());
assertThat(bundlesConfig2.toString(), containsString("bundle2"));
assertThat(bundlesConfig2.toString(), not(containsString("bundle1")));
}
Aggregations