Skip to content

Conversation

@Nefarious46
Copy link
Contributor

  • Void on delete
  • Procedures named accordingly
  • Controllers named accordingly

More info on PR #155

Currently RESTful path is file/capture/meta but should maybe differ a bit so that there is no confusion with capture/meta path.
Maybe something like capture/processing or file/capture/processing. Thoughts? @kortemik

@Nefarious46 Nefarious46 requested a review from kortemik May 21, 2025 06:21
@Nefarious46 Nefarious46 self-assigned this May 21, 2025
@Nefarious46 Nefarious46 added the enhancement New feature or request label May 21, 2025
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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

500 necessary here?

Copy link
Contributor Author

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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

500 here as well

Copy link
Contributor Author

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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

500

Copy link
Contributor Author

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);
Copy link
Collaborator

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));
Copy link
Collaborator

Choose a reason for hiding this comment

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

-> assertEquals

Copy link
Contributor Author

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() {
Copy link
Collaborator

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?

Copy link
Contributor Author

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();
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@Nefarious46 Nefarious46 force-pushed the FileProcessingTypeEndpointRefactor branch from 5e7efc5 to 0fde527 Compare June 24, 2025 09:44
@Nefarious46 Nefarious46 requested a review from eemhu June 24, 2025 09:44
@q22u q22u removed the review label Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants