Skip to content

test(core): add architecture and project guardrail unit tests#73

Merged
evebrnd merged 1 commit into
mainfrom
test/add-architecture-and-project-guardrails-unit-tests
Jun 19, 2026
Merged

test(core): add architecture and project guardrail unit tests#73
evebrnd merged 1 commit into
mainfrom
test/add-architecture-and-project-guardrails-unit-tests

Conversation

@evebrnd

@evebrnd evebrnd commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

PR Description

What this PR Provides

Integrate ArchUnit unit tests to validate our project architecture and the conventions we established.

Hexagonal constraints

Rule Scope
DOMAIN_MUST_NOT_DEPEND_ON_INFRASTRUCTURE The domain never depends on infrastructure.
DOMAIN_MUST_NOT_DEPEND_ON_FORBIDDEN_TECHNOLOGY The domain never depends on JPA, Spring Web, Spring Data JPA/repositories, Hibernate, MapStruct, JSLT, Jackson, Kafka, or HTTP clients.
DOMAIN_MUST_NOT_DEPEND_ON_JPA_ENTITIES The domain never depends on *JpaEntity persistence types.
LAYER_DEPENDENCIES_POINT_INWARD infrastructure may depend on domain, never the reverse.
PORTS_MUST_BE_INTERFACES Every class in domain.port is an interface.
PORT_NAMED_CLASSES_MUST_LIVE_IN_PORT_PACKAGE Every *Port contract lives in domain.port.
PORTS_IMPLEMENTED_ONLY_IN_ADAPTERS A port is implemented only by an infrastructure.adapters class.
DTOS_RESIDE_IN_API_DTO_PACKAGE Every *Dto, *DtoIn, *DtoOut lives in adapters.api.dto.
CONTROLLERS_MUST_NOT_ACCESS_PERSISTENCE Controllers never depend on the persistence adapter.
TRANSACTIONAL_NOT_ON_CONTROLLERS Controller classes are never @Transactional.
TRANSACTIONAL_METHODS_NOT_ON_CONTROLLERS Controller methods are never @Transactional.

Maintainability conventions

Rule Scope
FREE_OF_CYCLES No package cycles across the whole application.
DOMAIN_FREE_OF_CYCLES No cycles between domain sub-packages.
ADAPTERS_FREE_OF_CYCLES No cycles between infrastructure.adapters sub-packages.
NO_FIELD_INJECTION Beans use constructor injection, never field/@Value/setter injection.
NO_STANDARD_STREAMS No System.out/System.err/printStackTrace; use the SLF4J logger.
NO_JAVA_UTIL_LOGGING No java.util.logging; use SLF4J.
DOMAIN_MUST_NOT_LOG The domain never depends on a logging framework.
RUNTIME_EXCEPTIONS_ARE_NAMED_EXCEPTION Every runtime exception type is named *Exception.
EXCEPTIONS_LIVE_IN_DOMAIN_EXCEPTION_PACKAGE Every *Exception lives in domain.exception.
SERVICES_LIVE_IN_DOMAIN_SERVICE_PACKAGE Every *Service lives in domain.service.
CONTROLLERS_LIVE_IN_API_CONTROLLER_PACKAGE Every *Controller lives in adapters.api.controller.
MAPPERS_LIVE_IN_MAPPER_PACKAGE Every *Mapper lives in a mapper package.

Review

The reviewer must double-check these points:

  • The reviewer has tested the feature
  • The reviewer has reviewed the implementation of the feature
  • The documentation has been updated
  • The feature implementation respects the Technical Doc / ADR previously produced

How to test

  • Check CI

Breaking changes

N/A

@github-code-quality

github-code-quality Bot commented Jun 19, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: Java

Java / code-coverage/jacoco

The overall coverage in the branch is 89%. Coverage data for the branch is not yet available.

Show a code coverage summary of the most covered files.
File 4153856 +/-
com/decathlon/i...rDslParser.java 99%
com/decathlon/i...ionService.java 99%
com/decathlon/i...ityService.java 96%
com/decathlon/i...MapperImpl.java 90%
com/decathlon/i...MapperImpl.java 88%
com/decathlon/i...ionHandler.java 87%
com/decathlon/i...ionService.java 87%
com/decathlon/i...oOutMapper.java 86%
com/decathlon/i...cification.java 81%
com/decathlon/i...ionService.java 77%

Updated June 19, 2026 09:05 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@evebrnd evebrnd marked this pull request as ready for review June 19, 2026 09:02
@sonarqubecloud

Copy link
Copy Markdown

@evebrnd evebrnd merged commit bab4506 into main Jun 19, 2026
26 checks passed
@evebrnd evebrnd deleted the test/add-architecture-and-project-guardrails-unit-tests branch June 19, 2026 12:56
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.

2 participants