Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javadoc and ca #39

Merged
merged 9 commits into from
Dec 4, 2023
Merged

Javadoc and ca #39

merged 9 commits into from
Dec 4, 2023

Conversation

sarinali
Copy link
Collaborator

@sarinali sarinali commented Dec 4, 2023

Description

CA fix to File endpoints with added Javadoc comments for most public methods

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Through the frontend manually to ensure all enpoints act as before

Copy link
Member

@lucieyang1 lucieyang1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Coding style is great, easy to understand
  • Manually tested, seems like it still works as before! Tests are working well.
  • Test coverage is very good! I added some comments for lines the tests didn't cover, not sure if coverage there is possible.
  • Clean architecture looks good!
  • Javadoc looks good as well, present for public methods

LGTM, very nice :)

try {
return Optional.of(documentRepository.save(file));
} catch (Exception e) {
return Optional.empty();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity, why return an empty Optional here instead of an exception?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its handled later i think an if checks for an empty

private void setFileData() {
try {
this.data = this.serializePDF();
this.fileData = new FileDocument(this.name, this.data, LocalDate.now());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to test these lines?

Copy link
Collaborator Author

@sarinali sarinali Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is tested in update pdf!

Optional<FileDocument> result = fileDataAccessObject.uploadFile(fileInputData.getFileData());
headers.setContentType(MediaType.TEXT_PLAIN);
FileOutputData outputData = new FileOutputData();
if (result.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to test these lines?

Copy link
Collaborator Author

@sarinali sarinali Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry no, i don't think it is very easy to test this!

@sarinali sarinali merged commit a9b7156 into master Dec 4, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants