tests: fix test bugs
This commit is contained in:
parent
0bb65f710e
commit
4059d7c18d
|
@ -184,7 +184,10 @@ public class SecurityTests extends ElasticsearchTestCase {
|
|||
public void testUnsafeAccess() throws Exception {
|
||||
assumeTrue("test requires security manager", System.getSecurityManager() != null);
|
||||
try {
|
||||
Class.forName("sun.misc.Unsafe");
|
||||
// class could be legitimately loaded, so we might not fail until setAccessible
|
||||
Class.forName("sun.misc.Unsafe")
|
||||
.getDeclaredField("theUnsafe")
|
||||
.setAccessible(true);
|
||||
fail("didn't get expected exception");
|
||||
} catch (SecurityException expected) {
|
||||
// ok
|
||||
|
|
Loading…
Reference in New Issue