Skip to content

Commit b517565

Browse files
committed
Silence some warnings from IntelliJ
1 parent 6b5aec1 commit b517565

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SecurityIndexReaderWrapperIntegrationTests.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,7 @@ public void testDLSWithNestedDocs() throws Exception {
489489

490490
@Override
491491
protected IndicesAccessControl getIndicesAccessControl() {
492-
IndicesAccessControl indicesAccessControl = new IndicesAccessControl(
493-
true,
494-
Map.of(indexSettings().getIndex().getName(), indexAccessControl)
495-
);
496-
return indicesAccessControl;
492+
return new IndicesAccessControl(true, Map.of(indexSettings().getIndex().getName(), indexAccessControl));
497493
}
498494
};
499495

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SecurityIndexReaderWrapperUnitTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void tearDown() throws Exception {
8585
esIn.close();
8686
}
8787

88-
public void testDefaultMetaFields() throws Exception {
88+
public void testDefaultMetaFields() {
8989
securityIndexReaderWrapper = new SecurityIndexReaderWrapper(null, null, securityContext, licenseState, scriptService) {
9090
@Override
9191
protected IndicesAccessControl getIndicesAccessControl() {
@@ -115,22 +115,22 @@ protected IndicesAccessControl getIndicesAccessControl() {
115115
assertThat(result.getFilter().run("some_random_regular_field"), is(false));
116116
}
117117

118-
public void testWrapReaderWhenFeatureDisabled() throws Exception {
118+
public void testWrapReaderWhenFeatureDisabled() {
119119
when(licenseState.isAllowed(DOCUMENT_LEVEL_SECURITY_FEATURE)).thenReturn(false);
120120
securityIndexReaderWrapper = new SecurityIndexReaderWrapper(null, null, securityContext, licenseState, scriptService);
121121
DirectoryReader reader = securityIndexReaderWrapper.apply(esIn);
122122
assertThat(reader, sameInstance(esIn));
123123
}
124124

125-
public void testWildcards() throws Exception {
125+
public void testWildcards() {
126126
Set<String> expected = new HashSet<>(META_FIELDS);
127127
expected.add("field1_a");
128128
expected.add("field1_b");
129129
expected.add("field1_c");
130130
assertResolved(new FieldPermissions(fieldPermissionDef(new String[] { "field1*" }, null)), expected, "field", "field2");
131131
}
132132

133-
public void testDotNotion() throws Exception {
133+
public void testDotNotion() {
134134
Set<String> expected = new HashSet<>(META_FIELDS);
135135
expected.add("foo.bar");
136136
assertResolved(new FieldPermissions(fieldPermissionDef(new String[] { "foo.bar" }, null)), expected, "foo", "foo.baz", "bar.foo");
@@ -149,7 +149,7 @@ private void assertResolved(FieldPermissions permissions, Set<String> expected,
149149
}
150150
}
151151

152-
public void testFieldPermissionsWithFieldExceptions() throws Exception {
152+
public void testFieldPermissionsWithFieldExceptions() {
153153
securityIndexReaderWrapper = new SecurityIndexReaderWrapper(null, null, securityContext, licenseState, null);
154154
String[] grantedFields = new String[] {};
155155
String[] deniedFields;

0 commit comments

Comments
 (0)