Skip to content
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

🐛 [REST API] Fix ServiceConfigurations to return KapuaIllegalArgument instead of 204 #4064

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

MDeLuise
Copy link
Contributor

Description

The ServiceConfigurations class methods (update, getComponent, updateComponent) currently return 204 or null when the following check is not true:

if (KapuaConfigurableService.class.isAssignableFrom(configurableServiceClass)) {
   ...
}

This behavior does not appropriately handle invalid user-provided values.

Solution

This pull request updates the methods in ServiceConfigurations to throw a KapuaIllegalArgument exception when appropiate.

…ce pid

Update `ServiceConfigurations` methods to throw `KapuaIllegalArgument` when the provided pid is not a `KapuaConfigurableService`.
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.

Project coverage is 16.81%. Comparing base (2349705) to head (c090c8a).

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4064      +/-   ##
=============================================
- Coverage      16.81%   16.81%   -0.01%     
  Complexity        22       22              
=============================================
  Files           2008     2008              
  Lines          52164    52167       +3     
  Branches        4398     4398              
=============================================
  Hits            8770     8770              
- Misses         42998    43001       +3     
  Partials         396      396              
Files Coverage Δ
.../resources/v1/resources/ServiceConfigurations.java 0.00% <0.00%> (ø)

@Coduz Coduz added the Bug This is a bug or an unexpected behaviour. Fix it! label Jun 27, 2024
@Coduz Coduz changed the title Fix ServiceConfigurations to return KapuaIllegalArgument instead of 204 🐛 [REST API] Fix ServiceConfigurations to return KapuaIllegalArgument instead of 204 Jun 27, 2024
@Coduz Coduz merged commit 646e283 into eclipse:develop Jul 1, 2024
34 of 35 checks passed
@MDeLuise MDeLuise deleted the fix-kapuaIllegalArgument branch July 1, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug or an unexpected behaviour. Fix it!
Projects
Development

Successfully merging this pull request may close these issues.

2 participants