Unit testing a method that verifies a particular s3 bucket exists is simple because the unit test would not change the state of s3. However, unit testing a method that writes to an s3 bucket is more problematic because it actually changes the state of s3 every time the unit test is run. For example, a method that uses rdd.saveAsTextFile(path)
.
Can a unit test be written for a method that writes to s3 that still allows you to verify that the file got written?
Note: I thought about using a mock object, but wasn't sure how this might be implemented.
Aucun commentaire:
Enregistrer un commentaire