Search in sources :

Example 1 with ListConfigsResponse

use of com.yahoo.vespa.config.server.http.v2.HttpListConfigsHandler.ListConfigsResponse 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)1 HandlerTest (com.yahoo.vespa.config.server.http.HandlerTest)1 SessionHandlerTest (com.yahoo.vespa.config.server.http.SessionHandlerTest)1 ListConfigsResponse (com.yahoo.vespa.config.server.http.v2.HttpListConfigsHandler.ListConfigsResponse)1 Test (org.junit.Test)1