@Test
public void shouldReturnRedirectWithLocationIfCompareAndSetFailsBecauseNotLeaderExceptionIsThrownWithTheLeaderSetToAValidLeader() {

    when(distributedStore.compareAndSet(KEY, casValue)).thenReturn(Futures.<KeyValue>immediateFailedFuture(new NotLeaderException(self, leader)));
    assertThatValidCompareAndSetRequestReturnsErrorStatus(ClientResponse.Status.MOVED_PERMANENTLY);
}