KinesisProxy implements KinesisProxyInterface { protected static boolean isRecoverableException(AmazonServiceException ex) { if (ex.getErrorType() == null) { return false; } switch (ex.getErrorType()) { case Client: return ex instanceof ProvisionedThroughputExceededException; case Service: case Unknown: return true; default: return false; } } private  KinesisProxy(Properties configProps); static KinesisProxyInterface create(Properties configProps); @Override GetRecordsResult getRecords(String shardIterator, int maxRecordsToGet); @Override GetShardListResult getShardList(Map<String, String> streamNamesWithLastSeenShardIds); @Override String getShardIterator(StreamShardHandle shard, String shardIteratorType, @Nullable Object startingMarker);  }
@Test public void testIsRecoverableExceptionWithProvisionedThroughputExceeded() { final ProvisionedThroughputExceededException ex = new ProvisionedThroughputExceededException("asdf"); ex.setErrorType(ErrorType.Client); assertTrue(KinesisProxy.isRecoverableException(ex)); }
@Test public void testIsRecoverableExceptionWithServiceException() { final AmazonServiceException ex = new AmazonServiceException("asdf"); ex.setErrorType(ErrorType.Service); assertTrue(KinesisProxy.isRecoverableException(ex)); }
@Test public void testIsRecoverableExceptionWithExpiredIteratorException() { final ExpiredIteratorException ex = new ExpiredIteratorException("asdf"); ex.setErrorType(ErrorType.Client); assertFalse(KinesisProxy.isRecoverableException(ex)); }
@Test public void testIsRecoverableExceptionWithNullErrorType() { final AmazonServiceException ex = new AmazonServiceException("asdf"); ex.setErrorType(null); assertFalse(KinesisProxy.isRecoverableException(ex)); }