有没有办法使用 ArchUnit 强制执行这样的规则:
@ArchTest
static final ArchRule events_must_be_created_by_aggregates =
noConstructors().that().areDeclaredInClassesThat().areAssignableTo(Event.class).should().beCalledInClassesThat().areNotAssignableFrom(Aggregate.class)
.because("the aggregate should manage its own lifecycle and events");
这里的问题是beCalledInClassesThat
不存在,我找不到任何可以让我实施这样的测试的东西。