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

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