DAT-4687: Implement zip secure file, DAT-4944: Add SpaDeploymentController test coverage #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please see JIRA tickets for acceptance criteria:
DAT-4687: Implement zip secure file
In this issue, we are proposing adding the following two dependencies:
so that we can use the
ZipSecureFile
class in place of where we are currently using theZipFile
class. This provides some protection around certain circumstances that I can explain in our meeting tomorrow if you would like. Note that this required a few other, very minor, changes to subsequent lines of code where a certain zip-related class might be changed to the org.apache.commons version.DAT-4944: Add testing to SpaDeploymentController class
My main/only goal in this issue was to add minimally viable testing to the SpaDeploymentController class. I both wanted to do this because 1) I wanted the class to be tested and 2) I knew that adding tests would be a good way to learn more about the codebase. This adds at least 1 test per method. In those cases, I have tried to add a sufficient test of only the "happy path" of the controller method that might mock non-controller code/dependencies if any exist. We can test those within the context of those classes instead of in the context of this controller class.
As a result of these changes, I am also proposing that we move 2 private, business logic methods:
sanity()
andrequestTagging()
from SpaDeploymentController to SPAUploadHandler. Please let me know what you think about this. My main motivation(s) in moving these methods are to 1) keep our controller classes as lean and focused as possible and 2) these types of business logic methods seemed more appropriate in a service/handler class. However, if there is context I am missing surrounding this choice and these methods, please just let me know.