aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/searchdefinition/processing/ReservedDocumentNamesTestCase.java
blob: b2dd58e9fdf5f88e64d8990e8bf0b2345d013b16 (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 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchdefinition.processing;

import com.yahoo.searchdefinition.derived.AbstractExportingTestCase;
import com.yahoo.searchdefinition.parser.ParseException;
import org.junit.Test;

import java.io.IOException;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

/**
 * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
 */
public class ReservedDocumentNamesTestCase extends AbstractExportingTestCase {

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