@Test(expected = YarnException.class)
public void testUseError() throws Exception {

  String message = "Mock IOExcepiton!";
  when(cProtocol.use(isA(UseSharedCacheResourceRequest.class))).thenThrow(
      new IOException(message));
  client.use(mock(ApplicationId.class), "key");
}