Search in sources :

Example 1 with ListConfigsResponse

use of com.yahoo.vespa.config.server.http.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() {
    HttpListConfigsHandler.ListConfigsResponse resp = new ListConfigsResponse(new HashSet<ConfigKey<?>>(), null, "http://foo.com/config/v1/", true);
    assertEquals(resp.toUrl(new ConfigKey<>("myconfig", "my/id", "mynamespace"), true), "http://foo.com/config/v1/mynamespace.myconfig/my/id");
    assertEquals(resp.toUrl(new ConfigKey<>("myconfig", "my/id", "mynamespace"), false), "http://foo.com/config/v1/mynamespace.myconfig/my/id/");
    assertEquals(resp.getContentType(), "application/json");
}
Also used : ListConfigsResponse(com.yahoo.vespa.config.server.http.HttpListConfigsHandler.ListConfigsResponse) ConfigKey(com.yahoo.vespa.config.ConfigKey) ListConfigsResponse(com.yahoo.vespa.config.server.http.HttpListConfigsHandler.ListConfigsResponse) Test(org.junit.Test)

Aggregations

ConfigKey (com.yahoo.vespa.config.ConfigKey)1 ListConfigsResponse (com.yahoo.vespa.config.server.http.HttpListConfigsHandler.ListConfigsResponse)1 Test (org.junit.Test)1