@Test
public void testSetMetrics() {

  RedisFacade facade = mock(RedisFacade.class);
  SessionManager sm = mock(SessionManager.class);
  MetricRegistry metrics = spy(new MetricRegistry());
  SessionConfiguration conf = new SessionConfiguration();
  when(sm.getConfiguration()).thenReturn(conf);
  when(sm.getMetrics()).thenReturn(metrics);
  metrics.meter("com.amadeus.session.myapp.redis.sample");
  try (RedisSessionRepository rsr = new RedisSessionRepository(facade, "myapp", "localhost", ExpirationStrategy.NOTIF, false)) {
    rsr.setSessionManager(sm);
    verify(metrics).removeMatching(any(MetricFilter.class));
    verify(metrics, never()).meter("com.amadeus.session.myapp.redis.failover");
  }
}