Search in sources :

Example 21 with ConfigKey

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);
}
Also used : MockRequestHandler(com.yahoo.vespa.config.server.rpc.MockRequestHandler) ConfigKey(com.yahoo.vespa.config.ConfigKey) Tenants(com.yahoo.vespa.config.server.tenant.Tenants) Before(org.junit.Before)

Example 22 with ConfigKey

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);
}
Also used : MockRequestHandler(com.yahoo.vespa.config.server.rpc.MockRequestHandler) ConfigKey(com.yahoo.vespa.config.ConfigKey) Before(org.junit.Before)

Example 23 with ConfigKey

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");
}
Also used : ListConfigsResponse(com.yahoo.vespa.config.server.http.v2.HttpListConfigsHandler.ListConfigsResponse) ConfigKey(com.yahoo.vespa.config.ConfigKey) HandlerTest(com.yahoo.vespa.config.server.http.HandlerTest) Test(org.junit.Test) SessionHandlerTest(com.yahoo.vespa.config.server.http.SessionHandlerTest)

Aggregations

ConfigKey (com.yahoo.vespa.config.ConfigKey)23 Test (org.junit.Test)9 ApplicationId (com.yahoo.config.provision.ApplicationId)4 MockRequestHandler (com.yahoo.vespa.config.server.rpc.MockRequestHandler)4 Before (org.junit.Before)4 ConfigInstance (com.yahoo.config.ConfigInstance)3 ComponentId (com.yahoo.component.ComponentId)2 Version (com.yahoo.component.Version)2 ComponentClass (com.yahoo.component.provider.ComponentClass)2 TenantName (com.yahoo.config.provision.TenantName)2 HttpResponse (com.yahoo.container.jdisc.HttpResponse)2 RequestHandler (com.yahoo.vespa.config.server.RequestHandler)2 HandlerTest (com.yahoo.vespa.config.server.http.HandlerTest)2 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)2 Tenants (com.yahoo.vespa.config.server.tenant.Tenants)2 File (java.io.File)2 LbServicesConfig (com.yahoo.cloud.config.LbServicesConfig)1 RoutingConfig (com.yahoo.cloud.config.RoutingConfig)1 ConfigurationRuntimeException (com.yahoo.config.ConfigurationRuntimeException)1 IntConfig (com.yahoo.config.core.IntConfig)1