Skip to content

Conversation

@Nefarious46
Copy link
Contributor

  • Void on delete mapper
  • No exceptions signatures in unit tests
  • 409 conflict is now returned when in use and 404 when record not found
  • Updated apidoc
  • Separated FlowController to it's own controller
  • TestData is inserted before unit tests

More info on PR #155

@Nefarious46 Nefarious46 requested a review from kortemik May 27, 2025 08:09
@Nefarious46 Nefarious46 self-assigned this May 27, 2025
@Nefarious46 Nefarious46 added enhancement New feature or request review labels May 27, 2025
content = @Content),
@ApiResponse(responseCode = "404", description = "Flow or Storage 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 necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

500 s swapped to 400 s

@ApiResponse(responseCode = "404", description = "Flow storage does not exist",
content = @Content),
@ApiResponse(responseCode = "500", description = "Internal server error, contact admin", content = @Content)})
public ResponseEntity<String> delete(@PathVariable("flowId") int flowId, @PathVariable("id") int id) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the id storageId here or something different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is indeed storage_id, will rectify for clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This endpoint specifically removes storage from being specific to a flow.

schema = @Schema(implementation = Storage.class))}),
@ApiResponse(responseCode = "400", description = "Storage name already exists",
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

content = {@Content(mediaType = "application/json",
schema = @Schema(implementation = CaptureStorage.class))}),
@ApiResponse(responseCode = "400", description = "Capture storage does not exist with the given ID",
@ApiResponse(responseCode = "404", description = "Flow storage does not exist",
Copy link
Collaborator

Choose a reason for hiding this comment

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

capture storage or flow storage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes Flow Storage, Capture Storage requires Flow Storage to exist before assigning Storage to a Capture. This works as a middleman to specify which Flow is Storage being used in.

})
public ResponseEntity<String> linkStorageToCapture(@RequestBody CaptureStorage newCaptureStorage) {
LOGGER.info("About to insert <[{}]>",newCaptureStorage);
@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


<!-- insert ( capture_id INT, storage_id INT ) -->
<select id="createCaptureStorage" resultMap="insertedIDCapture" statementType="CALLABLE">
{CALL flow.add_storage_for_capture(#{param1},#{param2})}
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 be changed add->insert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not in the scope of this PR. Capture Storage feature comes in separate PR.

// Assertions
assertEquals(expectedFlow, actualFlow);
assertThat(
httpResponseStorage.getStatusLine().getStatusCode(),
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.

swapped all Thats to Equals


String responseStringGet = Assertions.assertDoesNotThrow(() -> EntityUtils.toString(entityGet, "UTF-8"));

String expectedJson = new Gson().toJson(expected);
Copy link
Collaborator

Choose a reason for hiding this comment

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

could use gson field variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

swapped

@Nefarious46 Nefarious46 force-pushed the FlowStorageEndpointRefactor branch from 3d091ee to e8226bd Compare June 25, 2025 11:43
@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