Skip to content

Repository files navigation

ArchUnitJava RAG Test Repository

Java 25 ArchUnitJava Maven Central License: MIT

An independent Maven consumer that proves ArchUnitJava can analyze a realistic compiled Java application from outside the library repository.

The fixture models a small retrieval-augmented-generation service with API, application, domain, infrastructure, and bootstrap packages. It contains healthy boundaries and two deliberate violations. The test suite must both accept the healthy rules and reject the known bad dependencies.

What this proves

Contract Expected result
Application behavior The RAG application compiles and its functional test passes
Domain does not depend on infrastructure Pass
Application uses domain ports rather than adapters Pass
API does not bypass the application layer Fail with UnsafeSearchController evidence
Infrastructure does not depend on delivery APIs Fail with LeakyAuditAdapter evidence
Mermaid dependency graph generation Pass and contain real application types
Configuration validation Pass without executing target classes

The deliberate violations are fixture data, not open defects. Their failure is asserted by JUnit, so the Maven build itself remains green.

Package architecture

bootstrap ───────> api ───────> application ───────> domain
    │                                                   ▲
    └────────────────────> infrastructure ──────────────┘

Deliberate violations:
api -------------------> infrastructure
infrastructure --------> api

The intended architecture is also captured in architecture.puml.

Run locally

ArchUnitJava 0.1.0 is resolved directly from Maven Central:

git clone https://github.com/TristanKruse/ArchUnitJava-TestRepo-RAG.git
cd ArchUnitJava-TestRepo-RAG
./mvnw verify

On Windows, use mvnw.cmd instead of mvnw.

Inspect the policies

ArchUnitJava is a test-scoped Maven dependency. Production application code has no dependency on the architecture-testing library.

Why a separate repository?

An in-repository example can accidentally rely on reactor state, implementation classes, or local paths. This repository exercises the same boundary a real adopter sees: a normal Maven artifact, compiled application bytecode, public APIs, and independently versioned configuration.

Security

The fixture is compiled normally by Maven. ArchUnitJava then reads the resulting class files as data; it does not load or initialize the target application classes during architecture analysis.

Licensed under the MIT License.

About

Independent Maven RAG fixture validating ArchUnitJava with passing and deliberately violated architecture rules

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages