Manfred Hanke

Results 114 comments of Manfred Hanke

`domainModels` [behaves like a setter](https://github.com/TNG/ArchUnit/blob/v1.0.1/archunit/src/main/java/com/tngtech/archunit/library/Architectures.java#L805-L828), i.e. does not extend the internal `domainModelPredicate` (and likewiese for `domainServices` and `applicationServices`). That is, when calling the methods multiple times, previous package identifiers are...

A discussion was started in [comments on StackOverflow](https://stackoverflow.com/a/76257355/13134095) (which is probably better continued here) 1. whether the second invocation of those methods should log a warning (or even throw an...

You're right; the generic type of [`org.junit.jupiter.api.Assertions.assertThrows`](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/Assertions.html#assertThrows(java.lang.Class,org.junit.jupiter.api.function.Executable)) does not show up in the byte code. ArchUnit therefore cannot directly distinguish `assertThrows` from `assertThrows`.

I wonder whether testing for [class objects referenced](https://www.javadoc.io/doc/com.tngtech.archunit/archunit/latest/com/tngtech/archunit/core/domain/JavaCodeUnit.html#getReferencedClassObjects()) from the same test method (it's not possible to attribute them directly to a method call) could be a useful workaround –...

You could already use [`@AnalyzeClasses`'s `packagesOf`](https://javadoc.io/doc/com.tngtech.archunit/archunit-junit5-api/latest/com/tngtech/archunit/junit/AnalyzeClasses.html#packagesOf()): ```java @AnalyzeClasses(packagesOf = {First.class, Second.class}) public class MyArchitectureTest { // ... } ``` This will however not only import `First` and `Second`, but their...

I fear that final method parameters might just exist in the Java language, but and in the byte code/JVM. (I'm saying "might" because I don't know much about the JVM...

I agree that this would be a nice addition to the API! For now, you can use the following workaround: ```java @ArchTest public final ArchRule methodShouldCallAudit = ArchRuleDefinition.methods().that() .areAnnotatedWith(Transactional.class) .should(ArchCondition.from(DescribedPredicate.describe("call...

This information should be available via [`JavaClass`'s `getSource()` method](https://javadoc.io/doc/com.tngtech.archunit/archunit/latest/com/tngtech/archunit/core/domain/JavaClass.html#getSource()): > [[`Source`](https://javadoc.io/doc/com.tngtech.archunit/archunit/latest/com/tngtech/archunit/core/domain/Source.html)] contains information about an imported class, i.e. the URI from where the class was imported and an md5 sum...

Oh! I thought that the `example/build/xxx` part would be different.

Just FYI: In my gradle multi-module project, `Source::getUri` gives me: * `file://$PROJECT_DIR/$MODULE_A/build/classes/java/main/com/….class` for classes `com.…` inside module A of my project * `jar:file:$PROJECT_DIR/$MODULE_B/build/libs/$MODULE_B.jar!/com/….class` for classes `com.…` in another module B...