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

Only target/test-classes are discovered in modular project when running tests from IntelliJ #321

Closed
tgolden-andplus opened this issue Feb 20, 2020 · 4 comments

Comments

@tgolden-andplus
Copy link

Looks like similar symptoms as spring-projects/spring-framework#21515 in that only the target/test-classes path is found when specifying a package that gets translated to a resource path.

Test looks like:

@AnalyzeClasses(packages = "com.mycompany.myapp")
public class ArchitectureConstraintsTest {

  @ArchTest
  public static final ArchRule controllersAnnotatedProperly = classes().that().haveSimpleNameEndingWith("Controller")
      .should().beAnnotatedWith(RestController.class);

  @ArchTest
  public static final ArchRule controllersAutowired = constructors().that().areDeclaredInClassesThat().haveSimpleNameEndingWith("Controller")
      .should().beAnnotatedWith(Autowired.class);
}
@codecholeric
Copy link
Collaborator

Could you supply a minimal example project to reproduce this? Theoretically ArchUnit should look into the module path, at least it works for JDK classes. But maybe there is some problem in modularized environments.

@tgolden-andplus
Copy link
Author

Sure, I'll try and minimize the example project I was working with to demonstrate this this weekend.

@codecholeric
Copy link
Collaborator

Did you get around to creating your example?

@codecholeric
Copy link
Collaborator

Closing this due to inactivity, feel free to reopen!

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