aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/vespa/model/content/ContentSchemaTest.java
blob: 1c75dea38b1a0d594c000726f3b08e84b775b175 (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
28
29
30
// 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 org.junit.jupiter.api.Test;

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

/**
 * @author Simon Thoresen Hult
 */
public class ContentSchemaTest {

    @Test
    void requireThatAccessorsWork() {
        ContentSearch search = new ContentSearch.Builder()
                .setQueryTimeout(1.0)
                .setVisibilityDelay(2.0)
                .build();
        assertEquals(1.0, search.getQueryTimeout(), 1E-6);
        assertEquals(2.0, search.getVisibilityDelay(), 1E-6);
    }

    @Test
    void requireThatDefaultsAreNull() {
        ContentSearch search = new ContentSearch.Builder().build();
        assertNull(search.getQueryTimeout());
        assertNull(search.getVisibilityDelay());
    }
}