blob: 6b25dc526d9c6c14c83c1c38c57379fe527b0c54 (
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
31
32
33
34
35
36
37
38
39
40
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.properties;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.Arrays;
import java.util.HashSet;
import com.yahoo.processing.request.properties.PropertyMap;
import org.junit.jupiter.api.Test;
/**
* @author <a href="mailto:arnebef@yahoo-inc.com">Arne Bergene Fossaa</a>
*/
@SuppressWarnings({"removal"})
public class SubPropertiesTestCase {
@Test
void testSubProperties() {
PropertyMap map = new PropertyMap() {
{
set("a.e", "1");
set("a.f", 2);
set("b.e", "3");
set("f", 3);
set("e", "2");
set("d", "a");
}
};
SubProperties sub = new SubProperties("a", map);
assertEquals("1", sub.get("e"));
assertEquals(2, sub.get("f"));
assertNull(sub.get("d"));
assertEquals(new HashSet<>(Arrays.asList("e", "f")), sub.listProperties("").keySet());
}
}
|