Manfred Hanke

Results 76 comments of Manfred Hanke

@slaverda I guess that `getModifiers().contains`_**`All`**_`(accessModifiers)` will rarely be true... 😉 Is your question whether `HasModifiers` should have something like this? ```java default boolean isPackagePrivate() { Set accessModifiers = EnumSet.of(JavaModifier.PRIVATE, JavaModifier.PROTECTED,...

> Try calling ArchUnit from a regular `@Test`; I couldn't find a way to get the required `JavaClasses` object You can use the [`ClassFileImporter`](https://javadoc.io/doc/com.tngtech.archunit/archunit/latest/com/tngtech/archunit/core/importer/ClassFileImporter.html), see also [ArchUnit-Examples → `example-plain`](https://github.com/TNG/ArchUnit-Examples/tree/main/example-plain/src/test/java/com/tngtech/archunit/exampletest).

Note that [the ArchUnit-Examples repository](https://github.com/TNG/ArchUnit-Examples) is autogenerated from the latest released version of [the archunit-example module of the ArchUnit repository](https://github.com/TNG/ArchUnit/tree/master/archunit-example).

One advantage of ArchUnit is that its tests can be executed just like any other unit test. For instance, if you use plain JUnit `@Test`s (like in [`ArchUnit-Examples`'s `example-plain`](https://github.com/TNG/ArchUnit-Examples/tree/main/example-plain/src/test/java/com/tngtech/archunit/exampletest)), you...

The current behavior seems fair to me, given that `MyClass.myMethod` is not directly annotated (which could be relevant in some use cases), but I understand your use case and agree...

ArchUnit is consistent with the bytecode: For this example: ```java class Parent { void parentMethod() { } static void staticParentMethod() { } } class Child extends Parent { void childMethod()...

The **good news** is that it's actually quite easy to use custom import options: With ```java class DoNotIncludeTestFixtures implements ImportOption { @Override public boolean includes(Location location) { return !isTestFixture(location); }...

> That's not what I'm seeing. Aargh... sorry! 🙈 I didn't notice that my IDE had apparently moved my example class from `src/testFixtures/java/` to `src/test/java/issue949/` when I tried to refactor...

I'm not aware that ArchUnit provides a direct API to obtain all [inner](https://javadoc.io/static/com.tngtech.archunit/archunit/1.0.0/com/tngtech/archunit/core/domain/JavaClass.html#isInnerClass()) / [nested](https://javadoc.io/static/com.tngtech.archunit/archunit/1.0.0/com/tngtech/archunit/core/domain/JavaClass.html#isNestedClass()) classes (note that there's a subtle difference) of a given `JavaClass`, but you can easily...

You need to write an `ArchRule` for `classes()` if you want to impose a class-level condition like _have exactly one public method,_ which I would implement with a custom predicate:...