Search in sources :

Example 1 with JerseyBundlesConfig

use of com.yahoo.container.di.config.JerseyBundlesConfig in project vespa by vespa-engine.

the class RestApiTest method packages_to_scan_are_included_in_config.

@Test
public void packages_to_scan_are_included_in_config() throws Exception {
    setup();
    JerseyBundlesConfig config = root.getConfig(JerseyBundlesConfig.class, context.getConfigId());
    assertThat(config.bundles(0).packages(), contains("com.yahoo.foo"));
}
Also used : JerseyBundlesConfig(com.yahoo.container.di.config.JerseyBundlesConfig) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 2 with JerseyBundlesConfig

use of com.yahoo.container.di.config.JerseyBundlesConfig in project vespa by vespa-engine.

the class RestApiTest method resource_bundles_are_included_in_config.

@Test
public void resource_bundles_are_included_in_config() throws Exception {
    setup();
    JerseyBundlesConfig config = root.getConfig(JerseyBundlesConfig.class, context.getConfigId());
    assertThat(config.bundles().size(), is(1));
    assertThat(config.bundles(0).spec(), is("my-jersey-bundle:1.0"));
}
Also used : JerseyBundlesConfig(com.yahoo.container.di.config.JerseyBundlesConfig) Test(org.junit.Test) DomBuilderTest(com.yahoo.config.model.builder.xml.test.DomBuilderTest)

Example 3 with JerseyBundlesConfig

use of com.yahoo.container.di.config.JerseyBundlesConfig 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

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