Skip to content

Ranger -5587 modified && condition to OR to resolve the issue of definition id #943

Open
abhiishek26 wants to merge 1 commit into
apache:masterfrom
abhiishek26:fix_put_definitions_id
Open

Ranger -5587 modified && condition to OR to resolve the issue of definition id #943
abhiishek26 wants to merge 1 commit into
apache:masterfrom
abhiishek26:fix_put_definitions_id

Conversation

@abhiishek26
Copy link
Copy Markdown

synchronization in put /definitions/{id}

What changes were proposed in this pull request?

The PUT api http://localhost:6080/service/plugins/definitions/{id} is not throwing error when different id is passed from url and json payload , the issue is because in of a && condition updateServiceDef in ServiceREST which should have been OR ,I have changed it . On changing the And condition to or it is proprly throwing error as expected .

@vyommani
Copy link
Copy Markdown
Contributor

can you add a Junit test if possible ?

@abhiishek26 abhiishek26 force-pushed the fix_put_definitions_id branch from 82aa6c9 to 6e7c092 Compare May 14, 2026 11:13
@abhiishek26
Copy link
Copy Markdown
Author

can you add a Junit test if possible ?

Hi Vyom I have added the unit tests . The existing unit tests covered most of the scenarios but
1>Earlier the case when json payload and request url ids were not matching but serviceDef name was not blank was getting passed but it should have failed . Unit test testUpdateServiceDefWithValidNameButMismatchedId. handles this case for the changes made .
2> Unit test test2updateServiceDef. was failing with null pointer exception for the changes made , I have modified it to handle the exception correctly .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants