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

I think LayerDependencyRulesWithRunnerTest.java is missing a ".check( classes )" #52

Closed
md42 opened this issue Dec 11, 2017 · 4 comments

Comments

@md42
Copy link

md42 commented Dec 11, 2017

without the ".check( classes )" it is not acutally testing what one might think

@codecholeric
Copy link
Collaborator

I think this should work as intended? The JUnit support actually takes care of calling check(classes) under the hood.
Did you maybe try to run the test using Gradle, but missed adding -Pexample to activate the @Category(Example.class)?
If so, there is an open issue #30, so in the near future, there should be a really straight forward example project 😃 (I just need to find the time...)
Anyway, if you start writing new tests with JUnit, then @RunWith(..) + @AnalyzeClasses(..) + ArchRule fields annotated with @ArchTest is enough, you can write tests exactly like in the example you mention, and they should be automatically checked against the classes specified in @AnalyzeClasses.
Does this work for you?

@codecholeric
Copy link
Collaborator

Can you give me an update on this, is this really an issue?

@md42
Copy link
Author

md42 commented Jan 1, 2018

Sorry for the late reply..
Checked the LayerDependencyRulesWithRunnerTest and it works as expected.
I think this is not a Bug.

I was using JUnit4 style in another test with method definition and forgot to call "check" method

@md42 md42 closed this as completed Jan 1, 2018
@codecholeric
Copy link
Collaborator

Ah, okay, glad to hear it. I think I know what you mean, it can be confusing, that you have to treat @ArchTest methods different than fields. The only other way would have been, to use the return value of the method, but in that case, you can use a field anyway, I guess...
Anyway, I'm happy there is no bug 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants