Repository navigation
[TODO/ENHC]: Error handling in TestController.java implemented validation - #1908
Conversation
Signed-off-by: Pranjali Bhardwaj <[email protected]>
|
@lbroudoux new pr created, i closed old ones with changes |
lbroudoux
left a comment
There was a problem hiding this comment.
Build is broken, code does not compile.
Signed-off-by: Pranjali Bhardwaj <[email protected]>
dipak0000812
left a comment
There was a problem hiding this comment.
Hi @PranjaliBhardwaj
The build failure comes from the logging statement, not the ResponseEntity change.
Microcks uses JBoss Logging, which does not support SLF4J-style {} placeholders.
This line:
log.warn("Secret '{}' specified in test request but not found", test.getSecretName());
ends up matching the (String, Throwable) overload, causing:
String cannot be converted to Throwable.
Using String.format(...) or string concatenation here should fix the compilation error and unblock build-install.
Signed-off-by: Pranjali Bhardwaj <[email protected]>
Signed-off-by: Pranjali Bhardwaj <[email protected]>
In fact, it's a bit more complex 😉 JBoss Logging is used in the Moreover, in the Actually, it's better to check that your PR locally compiles before submitting them... |
Signed-off-by: Pranjali Bhardwaj <[email protected]>
|
ok, new approach to handle this problem: As I was learning the project, I may have made a few mistakes. I hope they did not come across negatively. |
lbroudoux
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the changes and your patience!
[ENHANCEMENT]
issue: #1895
Description
Added validation: If a secret name is provided but not found in the repository, the method now returns an error instead of continuing with null.
Clear error message: Returns HTTP 400 (BAD_REQUEST) with: "Secret '{secretName}' not found. Please ensure the secret exists before creating the test."
Logging: Added a warning log when a secret is specified but not found for debugging.
Removed TODO: The TODO comment is resolved by implementing the validation.
The implementation:
Validates that if a secret name is provided, it must exist
Returns a clear, actionable error message
Uses appropriate HTTP status code (400 BAD_REQUEST)
Follows existing error handling patterns in the codebase
When a test request includes a secret name that doesn't exist, the API will return a clear error instead of silently proceeding.