KillJobRequest killJobRequest = recordFactory.newRecordInstance(
KillJobRequest.class);
killJobRequest.setJobId(app.getJobId());
try {
client.killJob(killJobRequest);
fail("viewonlyuser killed job");
} catch (YarnRemoteException e) {
Assert.assertTrue(e.getMessage().contains("User viewonlyuser cannot"));
}