Search code examples
javamavenintellij-ideaassertj

Maven + AssertJ + IntelliJ = confusion with scope?


I want to add a test framework to my current maven project in IntelliJ.

I choose AsserJ, because the style looked best to me. I tried their tutorial, but it fails to provide enough help. (http://joel-costigliola.github.io/assertj/assertj-core-quick-start.html)

My issues is that the scope "test" is not explained well enough. With that scope I cant even import the necessary AsserJ files. When I try "import static org.assertj.core.api.Assertions.*;", the import is not recognized and it says that Assertions cant be resolved.

Any suggestions that might help?


Solution

  • What is the structure of your code?

    https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html might help.

    "Test" scope imports libraries that are only available to classes that are under src/test/java