Skip to content

Commit

Permalink
Java 17 and JUnit5 (#5)
Browse files Browse the repository at this point in the history
* JUnit5
* Java 17
  • Loading branch information
michael-schnell authored Dec 27, 2023
1 parent 8f10952 commit a012200
Show file tree
Hide file tree
Showing 95 changed files with 369 additions and 548 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,36 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up JDK 11
uses: actions/setup-java@v2
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'zulu'
cache: maven

- name: Show versions
run: java -version && ./mvnw -version && gpg --version

- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v4
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.OSS_SONATYPE_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.OSS_SONATYPE_GPG_PASSPHRASE }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
!.mvn
target
META-INF
*.log
*.log
/pom.xml.versionsBackup
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Base classes for Domain Driven Design (DDD) with Java.
[![Coverage Status](https://sonarcloud.io/api/project_badges/measure?project=org.fuin%3Addd-4-java&metric=coverage)](https://sonarcloud.io/dashboard?id=org.fuin%3Addd-4-java)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.fuin/ddd-4-java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.fuin/ddd-4-java/)
[![LGPLv3 License](http://img.shields.io/badge/license-LGPLv3-blue.svg)](https://www.gnu.org/licenses/lgpl.html)
[![Java Development Kit 11](https://img.shields.io/badge/JDK-11-green.svg)](https://openjdk.java.net/projects/jdk/11/)
[![Java Development Kit 17](https://img.shields.io/badge/JDK-17-green.svg)](https://openjdk.java.net/projects/jdk/17/)

## Versions
- 0.5.x (or later) = **Java 11** with new **jakarta** namespace
- 0.5.x (or later) = **Java 17** with new **jakarta** namespace
- 0.3.x/0.4.x = **Java 11** before namespace change from 'javax' to 'jakarta'
- 0.2.1 = **Java 8**

Expand Down
38 changes: 19 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.fuin</groupId>
<artifactId>pom</artifactId>
<version>1.7.0</version>
<version>1.9.0</version>
</parent>

<artifactId>ddd-4-java</artifactId>
Expand All @@ -28,7 +28,7 @@
</issueManagement>

<properties>
<esc.version>0.5.0</esc.version>
<esc.version>0.6.0</esc.version>
</properties>

<dependencies>
Expand All @@ -44,51 +44,51 @@
<dependency>
<groupId>org.fuin</groupId>
<artifactId>objects4j</artifactId>
<version>0.8.0</version>
<version>0.9.0</version>
</dependency>

<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.0</version>
<version>3.0.2</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
<version>3.14.0</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.32</version>
<version>2.0.9</version>
</dependency>

<dependency>
<groupId>io.github.threeten-jaxb</groupId>
<artifactId>threeten-jaxb-core</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</dependency>

<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>2.0.1</version>
<version>2.1.3</version>
</dependency>

<dependency>
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-api</artifactId>
<version>2.0.0</version>
<version>3.0.0</version>
</dependency>

<!-- Test -->
Expand All @@ -102,37 +102,37 @@


<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.fuin</groupId>
<artifactId>units4j</artifactId>
<version>0.10.0</version>
<version>0.11.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>7.0.1.Final</version>
<version>8.0.1.Final</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>2.8.2</version>
<version>2.9.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>3.7.1</version>
<version>3.15.5</version>
<scope>test</scope>
</dependency>

Expand All @@ -146,14 +146,14 @@
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<version>2.0.2</version>
<version>3.0.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>3.0.2</version>
<version>4.0.4</version>
<scope>test</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/fuin/ddd4j/codegen/AggregateRootUuidVO.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
*/
package org.fuin.ddd4j.codegen;

import org.fuin.ddd4j.ddd.EntityType;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.fuin.ddd4j.ddd.EntityType;

/**
* UUID based aggregate root identifier value object.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/fuin/ddd4j/codegen/IntegerEntityIdVO.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
*/
package org.fuin.ddd4j.codegen;

import org.fuin.ddd4j.ddd.EntityType;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.fuin.ddd4j.ddd.EntityType;

/**
* Integer based entity identifier value object.
*/
Expand Down
11 changes: 3 additions & 8 deletions src/main/java/org/fuin/ddd4j/ddd/AbstractAggregateRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,12 @@
*/
package org.fuin.ddd4j.ddd;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import jakarta.validation.constraints.NotNull;

import org.fuin.objects4j.common.Contract;

import java.lang.reflect.Method;
import java.util.*;

/**
* Base class for aggregate roots.
*
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/fuin/ddd4j/ddd/AbstractDomainEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import jakarta.validation.constraints.NotNull;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.Nullable;

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/fuin/ddd4j/ddd/AbstractEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.fuin.ddd4j.ddd;

import jakarta.validation.constraints.NotNull;

import org.fuin.objects4j.common.Contract;

/**
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/org/fuin/ddd4j/ddd/AbstractEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,20 @@
*/
package org.fuin.ddd4j.ddd;

import java.time.ZonedDateTime;

import jakarta.validation.constraints.NotNull;

import io.github.threetenjaxb.core.ZonedDateTimeXmlAdapter;
import jakarta.json.bind.annotation.JsonbProperty;
import jakarta.json.bind.annotation.JsonbTypeAdapter;
import jakarta.validation.constraints.NotNull;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.Nullable;
import org.fuin.objects4j.ui.Label;
import org.fuin.objects4j.ui.Prompt;
import org.fuin.objects4j.ui.ShortLabel;
import org.fuin.objects4j.ui.Tooltip;

import io.github.threetenjaxb.core.ZonedDateTimeXmlAdapter;
import java.time.ZonedDateTime;

/**
* Base class for events. Equals and hash code are solely based on the event id.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@
*/
package org.fuin.ddd4j.ddd;

import static org.fuin.ddd4j.ddd.Ddd4JUtils.SHORT_ID_PREFIX;

import java.io.Serializable;

import jakarta.json.bind.annotation.JsonbProperty;
import jakarta.validation.constraints.NotNull;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;

import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.ExceptionShortIdentifable;
import org.fuin.objects4j.common.MarshalInformation;
import org.fuin.objects4j.common.ToExceptionCapable;
import org.fuin.objects4j.vo.ValueObject;

import java.io.Serializable;

import static org.fuin.ddd4j.ddd.Ddd4JUtils.SHORT_ID_PREFIX;

/**
* An aggregate already exists when trying to create it.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@
*/
package org.fuin.ddd4j.ddd;

import static org.fuin.ddd4j.ddd.Ddd4JUtils.SHORT_ID_PREFIX;

import java.io.Serializable;

import jakarta.json.bind.annotation.JsonbProperty;
import jakarta.validation.constraints.NotNull;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;

import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.ExceptionShortIdentifable;
import org.fuin.objects4j.common.MarshalInformation;
import org.fuin.objects4j.common.ToExceptionCapable;
import org.fuin.objects4j.vo.ValueObject;

import java.io.Serializable;

import static org.fuin.ddd4j.ddd.Ddd4JUtils.SHORT_ID_PREFIX;

/**
* Signals that an aggregate of a given type and identifier was deleted from the repository.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@
*/
package org.fuin.ddd4j.ddd;

import static org.fuin.ddd4j.ddd.Ddd4JUtils.SHORT_ID_PREFIX;

import java.io.Serializable;

import jakarta.json.bind.annotation.JsonbProperty;
import jakarta.validation.constraints.NotNull;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;

import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.ExceptionShortIdentifable;
import org.fuin.objects4j.common.MarshalInformation;
import org.fuin.objects4j.common.ToExceptionCapable;
import org.fuin.objects4j.vo.ValueObject;

import java.io.Serializable;

import static org.fuin.ddd4j.ddd.Ddd4JUtils.SHORT_ID_PREFIX;

/**
* Signals that an aggregate of a given type and identifier was not found in the repository.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/fuin/ddd4j/ddd/AggregateRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
*/
package org.fuin.ddd4j.ddd;

import java.util.List;

import jakarta.validation.constraints.NotNull;

import java.util.List;

/**
* Dedicated entity of a group of entities (The group is called "Aggregate") that guarantees the consistency of changes being made within
* the group by forbidding external objects from holding direct references to its members.
Expand Down
Loading

0 comments on commit a012200

Please sign in to comment.