Skip to content

Commit 8f2eddc

Browse files
committed
Fix refactor wonkiness
1 parent 5922f1f commit 8f2eddc

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilegeTests.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -140,41 +140,6 @@ public void testGetSingleSelectorWithFailuresSelectorOrThrow() {
140140
expectThrows(IllegalArgumentException.class, () -> IndexPrivilege.getSingleSelectorOrThrow(Set.of("none", "read_failure_store")));
141141
}
142142

143-
public void testGetSingleSelectorWithFailuresSelectorOrThrow() {
144-
assumeTrue("This test requires the failure store to be enabled", DataStream.isFailureStoreFeatureFlagEnabled());
145-
{
146-
IndexPrivilege actual = IndexPrivilege.getSingleSelectorOrThrow(Set.of("read_failure_store"));
147-
assertThat(actual, equalTo(IndexPrivilege.READ_FAILURE_STORE));
148-
assertThat(actual.getSelectorPredicate(), equalTo(IndexComponentSelectorPredicate.FAILURES));
149-
}
150-
{
151-
IndexPrivilege actual = IndexPrivilege.getSingleSelectorOrThrow(Set.of("all", "read_failure_store"));
152-
assertThat(actual.name(), equalTo(Set.of("all", "read_failure_store")));
153-
assertThat(actual.getSelectorPredicate(), equalTo(IndexComponentSelectorPredicate.ALL));
154-
assertThat(Automatons.subsetOf(IndexPrivilege.ALL.automaton, actual.automaton), is(true));
155-
}
156-
{
157-
IndexPrivilege actual = IndexPrivilege.getSingleSelectorOrThrow(
158-
Set.of("all", "indices:data/read/search", "read_failure_store")
159-
);
160-
assertThat(actual.name(), equalTo(Set.of("all", "indices:data/read/search", "read_failure_store")));
161-
assertThat(actual.getSelectorPredicate(), equalTo(IndexComponentSelectorPredicate.ALL));
162-
assertThat(Automatons.subsetOf(IndexPrivilege.ALL.automaton, actual.automaton), is(true));
163-
}
164-
{
165-
IndexPrivilege actual = IndexPrivilege.getSingleSelectorOrThrow(Set.of("all", "read", "read_failure_store"));
166-
assertThat(actual.name(), equalTo(Set.of("all", "read", "read_failure_store")));
167-
assertThat(actual.getSelectorPredicate(), equalTo(IndexComponentSelectorPredicate.ALL));
168-
assertThat(Automatons.subsetOf(IndexPrivilege.ALL.automaton, actual.automaton), is(true));
169-
}
170-
expectThrows(IllegalArgumentException.class, () -> IndexPrivilege.getSingleSelectorOrThrow(Set.of("read", "read_failure_store")));
171-
expectThrows(
172-
IllegalArgumentException.class,
173-
() -> IndexPrivilege.getSingleSelectorOrThrow(Set.of("indices:data/read/search", "read_failure_store"))
174-
);
175-
expectThrows(IllegalArgumentException.class, () -> IndexPrivilege.getSingleSelectorOrThrow(Set.of("none", "read_failure_store")));
176-
}
177-
178143
public void testPrivilegesForRollupFieldCapsAction() {
179144
final Collection<String> privileges = findPrivilegesThatGrant(GetRollupIndexCapsAction.NAME);
180145
assertThat(Set.copyOf(privileges), equalTo(Set.of("manage", "all", "view_index_metadata", "read")));

0 commit comments

Comments
 (0)