summaryrefslogtreecommitdiffstats
path: root/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/task/util/file/TemplarTest.java
blob: ed410ffc1d1137886eb5f5a3f7bb0431b01edac4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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.task.util.file;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * @author hakonhall
 */
public class TemplarTest {
    @Test
    public void test() {
        Templar templar = new Templar("x y <%= foo %>, some other <%=bar%> text");
        templar.set("foo", "fidelity")
                .set("bar", "halimov")
                .set("not", "used");

        assertEquals("x y fidelity, some other halimov text", templar.resolve());
    }
}