aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/vespa/model/content/ContentBaseTest.java
blob: 178de246e2dd88c56f47c9471d91b2fcdf049d28 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.content;

import com.yahoo.messagebus.routing.RouteSpec;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class ContentBaseTest {
    public static String getHosts() {
        return "<?xml version='1.0' encoding='utf-8' ?>" +
                "<hosts>  " +
                "  <host name='foo'>" +
                "    <alias>node0</alias>" +
                "  </host>" +
                "</hosts>";
    }

    static void assertRoute(RouteSpec r, String name, String... hops) {
        assertEquals(name, r.getName());
        assertEquals(hops.length, r.getNumHops());
        for(int i = 0; i < hops.length; i++) {
            assertEquals(hops[i], r.getHop(i));
        }
    }
}