Search in sources :

Example 1 with RestApiContext

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;
}
Also used : RestApiContext(com.yahoo.vespa.model.container.jersey.RestApiContext)

Example 2 with 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")));
}
Also used : JerseyBundlesConfig(com.yahoo.container.di.config.JerseyBundlesConfig) RestApiContext(com.yahoo.vespa.model.container.jersey.RestApiContext) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Aggregations

RestApiContext (com.yahoo.vespa.model.container.jersey.RestApiContext)2 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)1 JerseyBundlesConfig (com.yahoo.container.di.config.JerseyBundlesConfig)1 Test (org.junit.Test)1