### Question:
SpillLocationVerifier { public void checkBucketAuthZ(String spillBucket) { if (spillBucket == null || spillBucket.equals("")) { return; } if (bucket == null || !bucket.equals(spillBucket)) { logger.info("Spill bucket has been changed from {} to {}", bucket, spillBucket); bucket = spillBucket; state = BucketState.UNCHECKED; } if (state == BucketState.UNCHECKED) { updateBucketState(); } passOrFail(); } SpillLocationVerifier(AmazonS3 amazons3); void checkBucketAuthZ(String spillBucket);  }### Answer:
@Test public void checkBucketAuthZ() { logger.info("checkBucketAuthZ - enter"); Random random = new Random(); int index = random.nextInt(bucketNames.size()); try { spyVerifier.checkBucketAuthZ(bucketNames.get(index)); } catch(RuntimeException e) { fail("checkBucketAuthZ failed"); } verify(spyVerifier, times(1)).updateBucketState(); verify(spyVerifier, times(1)).passOrFail(); try { spyVerifier.checkBucketAuthZ(bucketNames.get(index)); } catch(RuntimeException e) { fail("checkBucketAuthZ failed"); } verify(spyVerifier, times(1)).updateBucketState(); verify(spyVerifier, times(2)).passOrFail(); try { spyVerifier.checkBucketAuthZ(""); } catch(RuntimeException e) { fail("checkBucketAuthZ failed"); } verify(spyVerifier, times(1)).updateBucketState(); verify(spyVerifier, times(2)).passOrFail(); logger.info("checkBucketAuthZ - exit"); }