@Test(expected = RuntimeException.class)
public void testReadFailure() throws Exception {

  when(repository.exists()).thenThrow(new RuntimeException());
  try {
    stateRepository.read();
  } catch (RuntimeException ex) {
    verify(metrics, times(1)).stateReadFailure(any(Exception.class));
    throw ex;
  }
}