-
Notifications
You must be signed in to change notification settings - Fork 6
Flow Storage endpoints refactored separately #173
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?
Flow Storage endpoints refactored separately #173
Conversation
| 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)}) |
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?
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 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) { |
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.
is the id storageId here or something different?
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.
it is indeed storage_id, will rectify for clarity.
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.
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) |
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
| 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", |
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.
capture storage or flow storage?
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.
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)}) |
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
|
|
||
| <!-- insert ( capture_id INT, storage_id INT ) --> | ||
| <select id="createCaptureStorage" resultMap="insertedIDCapture" statementType="CALLABLE"> | ||
| {CALL flow.add_storage_for_capture(#{param1},#{param2})} |
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 be changed add->insert?
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.
Not in the scope of this PR. Capture Storage feature comes in separate PR.
| // Assertions | ||
| assertEquals(expectedFlow, actualFlow); | ||
| assertThat( | ||
| httpResponseStorage.getStatusLine().getStatusCode(), |
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.
swapped all Thats to Equals
|
|
||
| String responseStringGet = Assertions.assertDoesNotThrow(() -> EntityUtils.toString(entityGet, "UTF-8")); | ||
|
|
||
| String expectedJson = new Gson().toJson(expected); |
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.
could use gson field variable?
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.
swapped
3d091ee to
e8226bd
Compare
More info on PR #155