try {
executeGetCoverageKvp(raw);
fail("This should have failed with a security exception");
} catch (Throwable e) {
// make sure we are dealing with some security exception
SpringSecurityException se = null;
while(e.getCause() != null && e.getCause() != e) {
e = e.getCause();
if(e instanceof SpringSecurityException) {
se = (SpringSecurityException) e;
}
}
if(e == null) {
fail("We should have got some sort of SpringSecurityException");
} else {
// some mumbling about not having enough privileges
assertTrue(se.getMessage().contains("World"));
assertTrue(se.getMessage().contains("privileges"));
}
}
}