Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshug committed Dec 26, 2020
1 parent 9276dc2 commit 6e4360c
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -25,6 +25,8 @@
import io.kubernetes.client.extended.leaderelection.LeaderElector;
import io.kubernetes.client.extended.leaderelection.Lock;
import io.kubernetes.client.openapi.ApiException;

import java.net.HttpURLConnection;
import java.time.Duration;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.Test;
Expand Down Expand Up @@ -56,7 +58,7 @@ public void testLeaderElectingController() throws ApiException {
record.set(new LeaderElectionRecord());

when(mockLock.identity()).thenReturn("foo");

when(mockLock.get()).thenThrow(new ApiException("Record Not Found", HttpURLConnection.HTTP_NOT_FOUND, null, null));
doAnswer(invocationOnMock -> record.get()).when(mockLock).get();

doAnswer(
Expand Down

0 comments on commit 6e4360c

Please sign in to comment.