use of com.yahoo.vespa.config.ConfigKey in project vespa by vespa-engine.
the class HttpGetConfigHandlerTest method setUp.
@Before
public void setUp() throws Exception {
mockRequestHandler = new MockRequestHandler();
mockRequestHandler.setAllConfigs(new HashSet<ConfigKey<?>>() {
{
add(new ConfigKey<>("bar", "myid", "foo"));
}
});
TestTenantBuilder tb = new TestTenantBuilder();
tb.createTenant(tenant).withRequestHandler(mockRequestHandler).build();
Tenants tenants = tb.createTenants();
handler = new HttpGetConfigHandler(HttpGetConfigHandler.testOnlyContext(), tenants);
}
use of com.yahoo.vespa.config.ConfigKey in project vespa by vespa-engine.
the class HttpGetConfigHandlerTest method setUp.
@Before
public void setUp() {
mockRequestHandler = new MockRequestHandler();
mockRequestHandler.setAllConfigs(new HashSet<ConfigKey<?>>() {
{
add(new ConfigKey<>("bar", "myid", "foo"));
}
});
handler = new HttpGetConfigHandler(HttpGetConfigHandler.testOnlyContext(), mockRequestHandler);
}
use of com.yahoo.vespa.config.ConfigKey in project vespa by vespa-engine.
the class HttpListConfigsHandlerTest method require_url_building_and_mimetype_correct.
@Test
public void require_url_building_and_mimetype_correct() {
ListConfigsResponse resp = new ListConfigsResponse(new HashSet<ConfigKey<?>>(), null, "http://foo.com/config/v2/tenant/mytenant/application/mya/", true);
assertEquals(resp.toUrl(new ConfigKey<>("myconfig", "my/id", "mynamespace"), true), "http://foo.com/config/v2/tenant/mytenant/application/mya/mynamespace.myconfig/my/id");
assertEquals(resp.toUrl(new ConfigKey<>("myconfig", "my/id", "mynamespace"), false), "http://foo.com/config/v2/tenant/mytenant/application/mya/mynamespace.myconfig/my/id/");
assertEquals(resp.toUrl(new ConfigKey<>("myconfig", "", "mynamespace"), false), "http://foo.com/config/v2/tenant/mytenant/application/mya/mynamespace.myconfig");
assertEquals(resp.toUrl(new ConfigKey<>("myconfig", "", "mynamespace"), true), "http://foo.com/config/v2/tenant/mytenant/application/mya/mynamespace.myconfig");
assertEquals(resp.getContentType(), "application/json");
}
Aggregations