Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.net.URLClassLoader;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -448,41 +449,42 @@ public void testFilesEntitlementsWithExclusive() {
var baseTestPath = Path.of("/base").toAbsolutePath();
var testPath1 = Path.of("/base/test").toAbsolutePath();
var testPath2 = Path.of("/base/test/foo").toAbsolutePath();
var iae = expectThrows(
IllegalArgumentException.class,
() -> new PolicyManager(
createEmptyTestServerPolicy(),
List.of(),
Map.of(
"plugin1",
new Policy(
"test",
var plugins = new LinkedHashMap<String, Policy>();
plugins.put("plugin1",
new Policy(
"test",
List.of(
new Scope(
"test.module1",
List.of(
new Scope(
"test.module1",
List.of(
new FilesEntitlement(
List.of(FilesEntitlement.FileData.ofPath(testPath1, FilesEntitlement.Mode.READ).withExclusive(true))
)
)
new FilesEntitlement(
List.of(FilesEntitlement.FileData.ofPath(testPath1, FilesEntitlement.Mode.READ).withExclusive(true))
)
)
),
"plugin2",
new Policy(
"test",
)
)
));
plugins.put(
"plugin2",
new Policy(
"test",
List.of(
new Scope(
"test.module2",
List.of(
new Scope(
"test.module2",
List.of(
new FilesEntitlement(
List.of(FilesEntitlement.FileData.ofPath(testPath1, FilesEntitlement.Mode.READ).withExclusive(true))
)
)
new FilesEntitlement(
List.of(FilesEntitlement.FileData.ofPath(testPath1, FilesEntitlement.Mode.READ).withExclusive(true))
)
)
)
),
)
));
var iae = expectThrows(
IllegalArgumentException.class,
() -> new PolicyManager(
createEmptyTestServerPolicy(),
List.of(),
plugins,
c -> "",
Map.of("plugin1", Path.of("modules", "plugin1"), "plugin2", Path.of("modules", "plugin2")),
TEST_AGENTS_PACKAGE_NAME,
Expand Down