blob: b7099a5f2bda18b6ce688510290685e9ef715cdf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.node.admin.provider;
import org.junit.jupiter.api.Test;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class DebugHandlerHelperTest {
@Test
void trivial() {
DebugHandlerHelper helper = new DebugHandlerHelper();
helper.addConstant("constant-key", "constant-value");
NodeAdminDebugHandler handler = () -> Map.of("handler-value-key", "handler-value-value");
helper.addHandler("handler-key", handler);
helper.addThreadSafeSupplier("supplier-key", () -> "supplier-value");
assertEquals("{" +
"supplier-key=supplier-value, " +
"handler-key={handler-value-key=handler-value-value}, " +
"constant-key=constant-value" +
"}",
helper.getDebugPage().toString());
}
}
|