Skip to content

Demo: ArchUnit Violation (Tight Coupling)#1

Open
khannedy wants to merge 2 commits into
mainfrom
demo/architecture-test
Open

Demo: ArchUnit Violation (Tight Coupling)#1
khannedy wants to merge 2 commits into
mainfrom
demo/architecture-test

Conversation

@khannedy

Copy link
Copy Markdown
Member

PR ini sengaja dibuat untuk simulasi tight coupling. Mengubah OrderService agar secara langsung memanggil ProductService alih-alih ProductClient, yang mana melanggar batas arsitektur Modular Monolith dan menyebabkan tes ArchUnit failed.

@khannedy

Copy link
Copy Markdown
Member Author

🚨 ArchUnit Violation Caught!

Saat Pull Request ini dibuat (dengan mensimulasikan tight coupling antara modul ecommerce-order dan ecommerce-product), proses validasi arsitektur otomatis mengagalkannya.

Berikut adalah error stack trace dari kegagalannya:

[ERROR] com.khannedy.ecommerce.ArchitectureTest.testModularMonolithBoundaries -- Time elapsed: 0.561 s <<< FAILURE!
Architecture Violation [Priority: MEDIUM] - Rule 'no classes that reside in a package '..ecommerce.order..' and reside outside of package '..ecommerce.order.client..' should depend on classes that reside in any package ['..ecommerce.product.controller..', '..ecommerce.product.service..', '..ecommerce.product.entity..', '..ecommerce.product.repository..', '..ecommerce.customer.controller..', '..ecommerce.customer.service..', '..ecommerce.customer.entity..', '..ecommerce.customer.repository..', '..ecommerce.payment.controller..', '..ecommerce.payment.service..', '..ecommerce.payment.entity..', '..ecommerce.payment.repository..', '..ecommerce.notification.service..', '..ecommerce.notification.entity..', '..ecommerce.notification.repository..']' was violated (5 times):
	at com.khannedy.ecommerce.ArchitectureTest.testModularMonolithBoundaries(ArchitectureTest.java:26)
[ERROR] Failures: 
[ERROR]   ArchitectureTest.testModularMonolithBoundaries:26 Architecture Violation [Priority: MEDIUM] - Rule 'no classes that reside in a package '..ecommerce.order..' and reside outside of package '..ecommerce.order.client..' should depend on classes that reside in any package [...]' was violated (5 times):
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO] BUILD FAILURE

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant