Skip to content

fix: return 404 for missing import jobs - #2156

Merged
lbroudoux merged 1 commit into
microcks:masterfrom
gyanranjanpanda:fix/issue-2155-job-not-found
Jun 9, 2026
Merged

lbroudoux merged 1 commit into
microcks:masterfrom
gyanranjanpanda:fix/issue-2155-job-not-found

Conversation

@gyanranjanpanda

Copy link
Copy Markdown
Contributor

Summary

  • return 404 Not Found when deleteJob receives an unknown job ID
  • return the same 404 Not Found response from activateJob
  • add regression tests for both endpoints

Root cause

deleteJob passed the nullable repository result to hasRoleForImportJob. For manager users, that method dereferenced the missing job and caused a NullPointerException.

Both endpoints now check whether the job exists before performing authorization. This also makes their behavior consistent with startJob and stopJob.

Validation

  • mvn -pl webapp -am -Dtest=JobControllerTest -Dsurefire.failIfNoSpecifiedTests=false test
  • Spotless checks run by the commit hook

Fixes #2155

@gyanranjanpanda
gyanranjanpanda marked this pull request as ready for review June 8, 2026 17:08
@gyanranjanpanda

Copy link
Copy Markdown
Contributor Author

could @lbroudoux review this

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thank you!

@lbroudoux lbroudoux added this to the 1.15.0 milestone Jun 9, 2026
@lbroudoux
lbroudoux merged commit 722da9a into microcks:master Jun 9, 2026
14 of 15 checks passed
@gyanranjanpanda
gyanranjanpanda deleted the fix/issue-2155-job-not-found branch June 9, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JobController.deleteJob throws NPE when deleting a non-existent job

2 participants