Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
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 @@ -69,7 +69,7 @@ public List<OrderedGrpcInterceptor> getOrderedGrpcInterceptors(ThreadContext thr

@Override
public int order() {
return 0;
return Integer.MIN_VALUE;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,20 @@ public void testNormalConfigurationReturnsInterceptor() {
assertTrue(e.getMessage().contains("GuiceHolder") || e instanceof NullPointerException);
}
}

@Test
public void testInterceptorOrderIsMinValue() {
Settings settings = Settings.builder().put(OpenSearchSecuritySSLPlugin.CLIENT_TYPE, "node").build();

securityGrpcFilter.initNodeSettings(settings);

List<GrpcInterceptorProvider.OrderedGrpcInterceptor> interceptors = securityGrpcFilter.getOrderedGrpcInterceptors(threadContext);

assertEquals("Should return exactly one interceptor", 1, interceptors.size());
assertEquals(
"Security interceptor should have highest priority (Integer.MIN_VALUE)",
Integer.MIN_VALUE,
interceptors.get(0).order()
);
}
}
Loading