-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor/remove-org.reflections.reflections-dependency #87
base: master
Are you sure you want to change the base?
refactor/remove-org.reflections.reflections-dependency #87
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general a great PR. I've added a few comments. Please see this link for more references. I believe for now this is a sufficient solution for truncating all tables, however, I still have my doubts whether the DatabaseIntegrationTest
is designed as it should.
Another directions would be:
- Truncate all tables from schema X via a native SQL statement.
- Rewrite the tests to allow order in the tests so no clearing in between tests has to happen.
src/test/java/org/example/realworldapi/DatabaseIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/example/realworldapi/DatabaseIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/example/realworldapi/DatabaseIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/example/realworldapi/DatabaseIntegrationTest.java
Outdated
Show resolved
Hide resolved
1123383
to
bf72c49
Compare
If the primary goal of that class is to roll back the database after each test, you can use the Ideally, this annotation should be applied to tests that modify the database. However, I applied it to entire classes, leaving the method-level annotation as a future optimization, since most of the methods change the database anyway. The issue I'm facing now is that some tests share a state instead of being able to run independently (see "TODO" in Conversely, the [1] https://quarkus.io/guides/getting-started-testing#tests-and-transactions |
366974b
to
b07bae0
Compare
- Utilized JPA's Metamodel API to retrieve all managed entity classes. - Prefixed instance variables and methods with `this.` to enhance code clarity. - Rename `AbstractIntegrationTest` to `IntegrationTestUtil`, and make its methods public so it can be used without requiring class inheritance. - Move `createNewArticle` method from `ArticlesResourceIntegrationTest` to `IntegrationTestUtil`. Signed-off-by: Pedro Aguiar <[email protected]>
b07bae0
to
7a633bf
Compare
this.
to enhance code clarity.