blob: 334fda6e6ebc2248c8dcd7a4e642ce2231c5a2aa (
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
41
42
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.model.application.provider;
import com.yahoo.config.FileReference;
import com.yahoo.config.application.api.FileRegistry;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
/**
* A file registry for testing, and, it seems, doubling as a null registry in some code paths.
*
* @author tonytv
*/
public class MockFileRegistry implements FileRegistry {
public FileReference addFile(String relativePath) {
return FileReferenceCreator.create("0123456789abcdef");
}
@Override
public String fileSourceHost() {
return "localhost.fortestingpurposesonly";
}
public static final Entry entry1 = new Entry("component/path1", FileReferenceCreator.create("1234"));
public static final Entry entry2 = new Entry("component/path2", FileReferenceCreator.create("56789"));
public List<Entry> export() {
List<Entry> result = new ArrayList<>();
result.add(entry1);
result.add(entry2);
return result;
}
@Override
public Set<String> allRelativePaths() {
return Collections.emptySet();
}
}
|