contextmapper / context-mapper-archunit-extension Goto Github PK
View Code? Open in Web Editor NEWValidate your code against the CML model with ArchUnit.
Home Page: https://contextmapper.org/
License: Apache License 2.0
Validate your code against the CML model with ArchUnit.
Home Page: https://contextmapper.org/
License: Apache License 2.0
Describe the bug
When I define a CommandEvent that has a reference to an attribute in the java code but is not the same type, the plugging didn't complain.
To Reproduce
Create your own CommandEvent in the model:
enum UserRole {
USER_ROLE_1,
USER_ROLE_2,
USER_ROLE_3,
USER_ROLE_4
}
CommandEvent UserChangeRolesCommand {
- UserId userId;
- UserRole userRoles;
- UserId submittedBy;
}
Then in your JAVA code, you make the error to define a list of enums, not just an enum:
@Command
@DomainRing
public final class UserChangeRolesCommand {
private final UserId userId;
private final List<UserRole> userRoles;
private final UserId submittedBy;
...
And when compile, the plugging is not complaining about the difference of types
Expected behaviour
I expect that If I define a list in the JAVA code and is not the same type in the model, the plugging complains
IDE and Plugin (please complete the following information):
IntelliJ IDEA 2022.3 (Ultimate Edition)
Build #IU-223.7571.182, built on November 29, 2022
Runtime version: 17.0.5+1-b653.14 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.0.1
GC: G1 Young Generation, G1 Old Generation
Non-Bundled Plugins:
com.intellij.kubernetes (223.7571.188)
com.dubreuia (2.3.0)
de.docksnet.puml.syntaxchecker (0.2.0)
PlantUML integration (5.20)
org.asciidoctor.intellij.asciidoc (0.38.3)
org.mapstruct.intellij (1.4.0)
com.haulmont.jpab (2022.5.1-223)
org.sonarlint.idea (7.2.1.58118)
Kotlin: 223-1.7.20-release-201-IJ7571.182
Currently this library is not working with archunit 1.x.x, due to a breaking change in archunit:
Used version of archunit: 1.0.1
Result when running org.contextmapper.archunitAbstractTacticArchUnitTest#entitiesShouldBeModeledInCML:
`java.lang.IncompatibleClassChangeError: Found interface com.tngtech.archunit.lang.ConditionEvents, but class was expected
at org.contextmapper.archunit.conditions.ModeledAsEntityInContext.check(ModeledAsEntityInContext.java:40)
at org.contextmapper.archunit.conditions.ModeledAsEntityInContext.check(ModeledAsEntityInContext.java:28)
at com.tngtech.archunit.lang.ArchRule$Factory$SimpleArchRule.evaluate(ArchRule.java:186)
at com.tngtech.archunit.lang.ArchRule$Assertions.check(ArchRule.java:84)
at com.tngtech.archunit.lang.ArchRule$Factory$SimpleArchRule.check(ArchRule.java:165)
at com.tngtech.archunit.lang.syntax.ObjectsShouldInternal.check(ObjectsShouldInternal.java:81)
at org.contextmapper.archunit.AbstractTacticArchUnitTest.entitiesShouldBeModeledInCML(AbstractTacticArchUnitTest.java:86)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.