private static String asNodeJson(String hostname, NodeType nodeType, String flavor, Optional<TenantName> reservedTo,
                                     Optional<ApplicationId> exclusiveTo, Optional<String> switchHostname,
                                     List<String> additionalIpAddresses, List<String> additionalHostnames, String... ipAddress) {
        return "{\"hostname\":\"" + hostname + "\", \"id\":\"" + hostname + "\"," +
               createIpAddresses(ipAddress) +
               "\"flavor\":\"" + flavor + "\"" +
               (reservedTo.map(tenantName -> ", \"reservedTo\":\"" + tenantName.value() + "\"").orElse("")) +
               (exclusiveTo.map(appId -> ", \"provisionedFor\":\"" + appId.serializedForm() + "\"").orElse("")) +
               (switchHostname.map(s -> ", \"switchHostname\":\"" + s + "\"").orElse("")) +
               (additionalIpAddresses.isEmpty() ? "" : ", \"additionalIpAddresses\":[\"" + String.join("\",\"", additionalIpAddresses) + "\"]") +
               (additionalHostnames.isEmpty() ? "" : ", \"additionalHostnames\":[\"" + String.join("\",\"", additionalHostnames) + "\"]") +
               ", \"type\":\"" + nodeType + "\"}";
    }
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