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

import com.yahoo.schema.derived.AbstractExportingTestCase;
import com.yahoo.schema.parser.ParseException;
import org.junit.jupiter.api.Test;

import java.io.IOException;

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

/**
 * @author Simon Thoresen Hult
 */
public class ReservedDocumentNamesTestCase extends AbstractExportingTestCase {

    @Test
    void requireThatPositionIsAReservedDocumentName() throws IOException, ParseException {
        try {
            assertCorrectDeriving("reserved_position");
            fail();
        } catch (IllegalArgumentException e) {
            assertEquals("For schema 'position': Document name 'position' is reserved.", e.getMessage());
        }
    }
}