Skip to content

Commit

Permalink
Fix compilation error peculiar to eclipse2018-09 (elastic#34798)
Browse files Browse the repository at this point in the history
Fix compilation error peculiar to eclipse2018-09.
Added generics to make eclipse compiler happy
  • Loading branch information
markharwood authored Oct 24, 2018
1 parent d73768f commit f7a6fb2
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,11 @@ public void testResolveAliasesAllGetAliasesRequestNoAuthorizedIndices() {
public void testRemotableRequestsAllowRemoteIndices() {
IndicesOptions options = IndicesOptions.fromOptions(true, false, false, false);
Tuple<TransportRequest, String> tuple = randomFrom(
new Tuple<>(new SearchRequest("remote:foo").indicesOptions(options), SearchAction.NAME),
new Tuple<>(new FieldCapabilitiesRequest().indices("remote:foo").indicesOptions(options), FieldCapabilitiesAction.NAME),
new Tuple<>(new GraphExploreRequest().indices("remote:foo").indicesOptions(options), GraphExploreAction.NAME)
new Tuple<TransportRequest, String>(new SearchRequest("remote:foo").indicesOptions(options), SearchAction.NAME),
new Tuple<TransportRequest, String>(new FieldCapabilitiesRequest().indices("remote:foo").indicesOptions(options),
FieldCapabilitiesAction.NAME),
new Tuple<TransportRequest, String>(new GraphExploreRequest().indices("remote:foo").indicesOptions(options),
GraphExploreAction.NAME)
);
final TransportRequest request = tuple.v1();
ResolvedIndices resolved = resolveIndices(request, buildAuthorizedIndices(user, tuple.v2()));
Expand All @@ -1143,9 +1145,9 @@ public void testRemotableRequestsAllowRemoteIndices() {
public void testNonRemotableRequestDoesNotAllowRemoteIndices() {
IndicesOptions options = IndicesOptions.fromOptions(true, false, false, false);
Tuple<TransportRequest, String> tuple = randomFrom(
new Tuple<>(new CloseIndexRequest("remote:foo").indicesOptions(options), CloseIndexAction.NAME),
new Tuple<>(new DeleteIndexRequest("remote:foo").indicesOptions(options), DeleteIndexAction.NAME),
new Tuple<>(new PutMappingRequest("remote:foo").indicesOptions(options), PutMappingAction.NAME)
new Tuple<TransportRequest, String>(new CloseIndexRequest("remote:foo").indicesOptions(options), CloseIndexAction.NAME),
new Tuple<TransportRequest, String>(new DeleteIndexRequest("remote:foo").indicesOptions(options), DeleteIndexAction.NAME),
new Tuple<TransportRequest, String>(new PutMappingRequest("remote:foo").indicesOptions(options), PutMappingAction.NAME)
);
IndexNotFoundException e = expectThrows(IndexNotFoundException.class,
() -> resolveIndices(tuple.v1(), buildAuthorizedIndices(user, tuple.v2())).getLocal());
Expand All @@ -1155,9 +1157,9 @@ public void testNonRemotableRequestDoesNotAllowRemoteIndices() {
public void testNonRemotableRequestDoesNotAllowRemoteWildcardIndices() {
IndicesOptions options = IndicesOptions.fromOptions(randomBoolean(), true, true, true);
Tuple<TransportRequest, String> tuple = randomFrom(
new Tuple<>(new CloseIndexRequest("*:*").indicesOptions(options), CloseIndexAction.NAME),
new Tuple<>(new DeleteIndexRequest("*:*").indicesOptions(options), DeleteIndexAction.NAME),
new Tuple<>(new PutMappingRequest("*:*").indicesOptions(options), PutMappingAction.NAME)
new Tuple<TransportRequest, String>(new CloseIndexRequest("*:*").indicesOptions(options), CloseIndexAction.NAME),
new Tuple<TransportRequest, String>(new DeleteIndexRequest("*:*").indicesOptions(options), DeleteIndexAction.NAME),
new Tuple<TransportRequest, String>(new PutMappingRequest("*:*").indicesOptions(options), PutMappingAction.NAME)
);
final ResolvedIndices resolved = resolveIndices(tuple.v1(), buildAuthorizedIndices(user, tuple.v2()));
assertNoIndices((IndicesRequest.Replaceable) tuple.v1(), resolved);
Expand Down

0 comments on commit f7a6fb2

Please sign in to comment.