use of com.yahoo.container.jdisc.JdiscBindingsConfig in project vespa by vespa-engine.
the class ApplicationStatusHandlerTest method request_handlers_are_rendered.
@Test
public void request_handlers_are_rendered() throws Exception {
final String id = "myHandler";
final String serverBinding1 = "http://*/serverBinding";
final String serverBinding2 = "http://*/anotherServerBinding";
final String clientBinding = "http://*/clientBinding";
HashMap<ComponentId, RequestHandler> handlersById = new HashMap<>();
handlersById.put(new ComponentId(id), Mockito.mock(RequestHandler.class));
JdiscBindingsConfig bindingsConfig = new JdiscBindingsConfig(new JdiscBindingsConfig.Builder().handlers(id, new Handlers.Builder().serverBindings(serverBinding1).serverBindings(serverBinding2).clientBindings(clientBinding)));
String json = ApplicationStatusHandler.renderRequestHandlers(bindingsConfig, handlersById).toString();
assertThat(json, containsString("\"" + id + "\""));
assertThat(json, containsString(serverBinding1));
assertThat(json, containsString(serverBinding2));
assertThat(json, containsString(clientBinding));
}
Aggregations