Skip to content

Refactor/assert j best practices#1450

Closed
lprimak wants to merge 8 commits intoapache:mainfrom
timtebeek:refactor/assert-j-best-practices
Closed

Refactor/assert j best practices#1450
lprimak wants to merge 8 commits intoapache:mainfrom
timtebeek:refactor/assert-j-best-practices

Conversation

@lprimak
Copy link
Copy Markdown
Contributor

@lprimak lprimak commented May 2, 2024

Following this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GitHub issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a GitHub issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [#XXX] - Fixes bug in SessionManager,
    where you replace #XXX with the appropriate GitHub issue. Best practice
    is to use the GitHub issue title in the pull request title and in the first line of the commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • add fixes #XXX if merging the PR should close a related issue.
  • Run mvn verify to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If you have a group of commits related to the same change, please squash your commits into one and force push your branch using git rebase -i.
  • Committers: Make sure a milestone is set on the PR

Trivial changes like typos do not require a GitHub issue (javadoc, comments...).
In this case, just format the pull request title like [DOC] - Add javadoc in SessionManager.

If this is your first contribution, you have to read the Contribution Guidelines

If your pull request is about ~20 lines of code you don't need to sign an Individual Contributor License Agreement
if you are unsure please ask on the developers list.

To make clear that you license your contribution under the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@lprimak lprimak requested a review from bmarwell May 2, 2024 08:01
@lprimak lprimak added this to the 2.0.1 milestone May 2, 2024
import org.apache.shiro.authc.UsernamePasswordToken;

import static org.apache.shiro.ee.util.JakartaTransformer.jakartify;
import static org.assertj.core.api.Assertions.assertThat;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems to have brought on an error in the tests, despite there being a transitive assertj dependency.

[INFO] Running org.apache.shiro.testing.cdi.ComponentInjectionIT
Error:  Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 16.51 s <<< FAILURE! -- in org.apache.shiro.testing.cdi.ComponentInjectionIT
Error:  org.apache.shiro.testing.cdi.ComponentInjectionIT.principalInjection -- Time elapsed: 0.407 s <<< ERROR!
java.lang.NoClassDefFoundError: org/assertj/core/api/Assertions
	at org.apache.shiro.testing.cdi.ComponentInjectionIT.principalInjection(ComponentInjectionIT.java:107)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.arquillian.junit5.ArquillianExtension.interceptTestMethod(ArquillianExtension.java:87)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
Caused by: java.lang.ClassNotFoundException: org.assertj.core.api.Assertions
	at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1821)
	at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1662)
	... 5 more

How would we want to see this resolved?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Probably Arquillian deployment method needs to be updated with AssertJ classes

Copy link
Copy Markdown
Contributor

@bmarwell bmarwell left a comment

Choose a reason for hiding this comment

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

I have done similar migrations in the past with similar-sized projects. You have my go when all the tests work. I did peek into ~30 files and saw no changes I would not approve.

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