@Test
public void testValidateImpersonatorInvalid() {

    String[] users = {ALICE, BOB, CHARLIE};
    for (String user : users) {
        try {
            ProxyUserValidation.validateImpersonator(SPARK, user);
            fail();
        } catch (StatusRuntimeException e) {
            assertEquals(Status.PERMISSION_DENIED.getCode(), e.getStatus().getCode());
            assertEquals("Impersonation disallowed for `spark/testhost@EXAMPLE.COM`", e.getStatus().getDescription());
        }
    }
}