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

Cannot resolve symbol 'Assertions' #520

Closed
theluxury opened this issue Nov 13, 2015 · 7 comments
Closed

Cannot resolve symbol 'Assertions' #520

theluxury opened this issue Nov 13, 2015 · 7 comments

Comments

@theluxury
Copy link

Installed via Maven,

import static org.assertj.core.api.*; 

works fine, but

import static org.assertj.core.api.Assertions.*; 

raises a Cannot resolve symbol 'Assertions' error. Using Java 1.8 with version 3.2.0

@joel-costigliola
Copy link
Member

Just tested, it runs fine, can you provide a full test case ?

@theluxury
Copy link
Author

What exactly do you mean test case?

@joel-costigliola
Copy link
Member

A unit test to reproduce the problem along with the proper environment description.
it can be a simple maven project containing a single test.

@theluxury
Copy link
Author

Here is the github repo for my project. The java class in question is Problem_5_4.java at https://github.com/theluxury/epi-java/blob/master/src/main/java/Problem_5_4.java. It doesn't actually have any methods form your api since

import static org.assertj.core.api.Assertions.*; 

raises the error. Please let me know if this is too much or not enough info.

@joel-costigliola
Copy link
Member

what are you importing it if you don't use it ?
my guess is your IDE compiler settings raise an error for unused import.

@theluxury
Copy link
Author

Well I was tried using it but didn't since I couldn't import it, heh. I updated it with a version that has an

assertThat("aaa").contains('a');

and am getting the error

Cannot resolve method assertThat(java.lang.String)

@joel-costigliola
Copy link
Member

You don't use maven properly, one can't use test dependencies in src/main/java, either move your tests to src/test/java or get rid of <scope>test</scope> when declaring assertj dependency.

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

No branches or pull requests

2 participants