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

Fix code scanning alert - Deprecated method or constructor invocation #1010

Closed
1 task done
sleberknight opened this issue Aug 6, 2023 · 0 comments · Fixed by #1012
Closed
1 task done

Fix code scanning alert - Deprecated method or constructor invocation #1010

sleberknight opened this issue Aug 6, 2023 · 0 comments · Fixed by #1012
Labels
code cleanup Fix issues reported by Sonar or any other code analysis tools
Milestone

Comments

@sleberknight
Copy link
Member

sleberknight commented Aug 6, 2023

Tracking issue for:

The line numbers are incorrect in the above code scanning result (due to Lombok). The line is actually number 42 (because of course it is...) on the saveAndClearSession method.

@sleberknight sleberknight added the code cleanup Fix issues reported by Sonar or any other code analysis tools label Aug 6, 2023
@sleberknight sleberknight added this to the 3.0.0 milestone Aug 6, 2023
sleberknight added a commit that referenced this issue Aug 6, 2023
Replace Session#save with #persist. To make this work, needed to
first create an interface, IdentifiableEntity, which provides get
and set methods for the ID. Then, in the test setup, begin a
transaction, change #save to #persist in
UserTypeTestHelpers#saveAndClearSession and get the ID.
Finally, rollback the transaction in the test tear down.

Closes #1010
sleberknight added a commit that referenced this issue Aug 6, 2023
Replace Session#save with #persist. To make this work, needed to
first create an interface, IdentifiableEntity, which provides get
and set methods for the ID. Then, in the test setup, begin a
transaction, change #save to #persist in
UserTypeTestHelpers#saveAndClearSession and get the ID.
Finally, rollback the transaction in the test tear down.

Add assertion to make sure there is a transaction (for future usages)
in #saveAndClearSession so that it is clear what the problem is
if anyone calls this method without a Transaction for a Session.

Also, add Transaction in JSONBUserTypeIntegrationTest.

Closes #1010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Fix issues reported by Sonar or any other code analysis tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant