Skip to content

Commit 45eb0f2

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 597f5f9 commit 45eb0f2

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

libs/entitlement/src/test/java/org/elasticsearch/entitlement/runtime/policy/entitlements/FilesEntitlementTests.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,25 +116,29 @@ public void testPathSettingResolve() {
116116

117117
public void testPathSettingIgnoreUrl() {
118118
var fileData = FileData.ofPathSetting("foo.*.bar", READ, true);
119-
settings = Settings.builder()
120-
.put("foo.nonurl.bar", "/setting/path")
121-
.put("foo.url.bar", "https://mysite").build();
119+
settings = Settings.builder().put("foo.nonurl.bar", "/setting/path").put("foo.url.bar", "https://mysite").build();
122120
assertThat(fileData.resolvePaths(TEST_PATH_LOOKUP).toList(), contains(Path.of("/setting/path")));
123121
}
124122

125123
public void testRelativePathSettingIgnoreUrl() {
126124
var fileData = FileData.ofRelativePathSetting("foo.*.bar", CONFIG, READ, true);
127-
settings = Settings.builder()
128-
.put("foo.nonurl.bar", "path")
129-
.put("foo.url.bar", "https://mysite").build();
125+
settings = Settings.builder().put("foo.nonurl.bar", "path").put("foo.url.bar", "https://mysite").build();
130126
assertThat(fileData.resolvePaths(TEST_PATH_LOOKUP).toList(), contains(Path.of("/config/path")));
131127
}
132128

133129
public void testIgnoreUrlValidation() {
134-
var e = expectThrows(PolicyValidationException.class, () -> FilesEntitlement.build(List.of(Map.of("path", "/foo", "mode", "read", "ignore_url", "true"))));
130+
var e = expectThrows(
131+
PolicyValidationException.class,
132+
() -> FilesEntitlement.build(List.of(Map.of("path", "/foo", "mode", "read", "ignore_url", "true")))
133+
);
135134
assertThat(e.getMessage(), is("'ignore_url' may only be used with `path_setting` or `relative_path_setting`"));
136135

137-
e = expectThrows(PolicyValidationException.class, () -> FilesEntitlement.build(List.of(Map.of("relative_path", "foo", "relative_to", "config", "mode", "read", "ignore_url", "true"))));
136+
e = expectThrows(
137+
PolicyValidationException.class,
138+
() -> FilesEntitlement.build(
139+
List.of(Map.of("relative_path", "foo", "relative_to", "config", "mode", "read", "ignore_url", "true"))
140+
)
141+
);
138142
assertThat(e.getMessage(), is("'ignore_url' may only be used with `path_setting` or `relative_path_setting`"));
139143
}
140144
}

0 commit comments

Comments
 (0)