@Test
    public void test_node_switch_hostname() throws Exception {
        String hostname = "host42.yahoo.com";
        // Add host with switch hostname
        String json = asNodeJson(hostname, NodeType.host, "default", Optional.empty(), Optional.empty(),
                Optional.of("switch0"), List.of(), List.of(), "127.0.42.1", "::42:1");
        assertResponse(new Request("http://localhost:8080/nodes/v2/node",
                                   ("[" + json + "]").getBytes(StandardCharsets.UTF_8),
                                   Request.Method.POST),
                       "{\"message\":\"Added 1 nodes to the provisioned state\"}");
        tester.assertResponseContains(new Request("http://localhost:8080/nodes/v2/node/" + hostname), "\"switchHostname\":\"switch0\"");

        // Update switch hostname
        json = "{\"switchHostname\":\"switch1\"}";
        assertResponse(new Request("http://localhost:8080/nodes/v2/node/" + hostname, json.getBytes(StandardCharsets.UTF_8), Request.Method.PATCH),
                       "{\"message\":\"Updated host42.yahoo.com\"}");
        tester.assertResponseContains(new Request("http://localhost:8080/nodes/v2/node/" + hostname), "\"switchHostname\":\"switch1\"");

        // Clear switch hostname
        json = "{\"switchHostname\":null}";
        assertResponse(new Request("http://localhost:8080/nodes/v2/node/" + hostname, json.getBytes(StandardCharsets.UTF_8), Request.Method.PATCH),
                       "{\"message\":\"Updated host42.yahoo.com\"}");
        tester.assertPartialResponse(new Request("http://localhost:8080/nodes/v2/node/" + hostname), "switchHostname", false);
    }
Tests the rendering of each node separately to make it easier to find errors
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/NodesV2ApiTest.java