@Test
public void testRead() throws Exception {

  MysqlSourceState state = mock(MysqlSourceState.class);
  when(repository.get()).thenReturn(state);
  when(repository.exists()).thenReturn(false);
  assertNull(stateRepository.read());
  when(repository.exists()).thenReturn(true);
  Assert.assertEquals(state, stateRepository.read());
  verify(metrics, times(2)).stateRead();
}