-
Notifications
You must be signed in to change notification settings - Fork 6
File Processing Type endpoints refactored separately #170
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
base: main
Are you sure you want to change the base?
File Processing Type endpoints refactored separately #170
Conversation
| schema = @Schema(implementation = FileProcessing.class))}), | ||
| @ApiResponse(responseCode = "400", description = "Inputvalue must be regex or newline", | ||
| content = @Content), | ||
| @ApiResponse(responseCode = "500", description = "Internal server error, contact admin", content = @Content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
500 necessary here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed 500 to 400.
| @ApiResponse(responseCode = "400", description = "File processing type does not exist with the given id", | ||
| @ApiResponse(responseCode = "404", description = "File processing type does not exist", | ||
| content = @Content), | ||
| @ApiResponse(responseCode = "500", description = "Internal server error, contact admin", content = @Content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
500 here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed 500 to 400.
| content = @Content), | ||
| @ApiResponse(responseCode = "404", description = "File processing type does not exist", | ||
| content = @Content), | ||
| @ApiResponse(responseCode = "500", description = "Internal server error, contact admin", content = @Content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
500
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed 500 to 400.
| String actual = Assertions.assertDoesNotThrow(() -> responseAsJson.get("message").toString()); | ||
|
|
||
| // Assertions | ||
| assertEquals(expected, actual); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this also assert the response code?
| String responseStringGet = Assertions.assertDoesNotThrow(() -> EntityUtils.toString(entityGet, "UTF-8")); | ||
|
|
||
| assertEquals(json, responseStringGet); | ||
| assertThat(responseGet.getStatusLine().getStatusCode(), equalTo(HttpStatus.SC_OK)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-> assertEquals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched.
| @Test | ||
| @Order(2) | ||
| public void testGetFileProcessingTypeByName() throws Exception { | ||
| public void testGetFileProcessingTypeById() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should perhaps add invalid id test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added testGetFileProcessingTypeByInvalidId to check if invalid ID is used to fetch record.
| @Order(3) | ||
| public void testGetAllFileProcessingTypesTypes() throws Exception { | ||
| public void testGetAllFileProcessingTypes() { | ||
| GsonBuilder gson2 = new GsonBuilder().serializeNulls(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no file processing types case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added testGetAll at the start to check this behaviour. Funny thing to notice here, testGetAllFileProcessingTypesNoResults name did not work since it was executed last even tho order was 1 and test was added first thing in the unit test class.
5e7efc5 to
0fde527
Compare
More info on PR #155
Currently RESTful path is
file/capture/metabut should maybe differ a bit so that there is no confusion withcapture/metapath.Maybe something like
capture/processingorfile/capture/processing. Thoughts? @kortemik