Skip to content

Commit 14a930f

Browse files
Feature/constrainable usage (#7)
* Extend Constrainable usage scenarios * Add scenario to illustrate how the 'Constrainable' can be used for flow-control * Remove SerentiyBDD and document reasoning * Update Changelog * Update documentation * Boyscouting: clean up legacy github actions * Update documentation * Fixup: References from README * Attempt to resolve broken links by adding symlinks to the `.github` directory * see: issue #6 in github issue tracker * Add code convention tests using ArchUnit * Update library and fix issue in documentation * Fix deprecated Assertion usage --------- Co-authored-by: stijn-dejongh <stijn-dejongh@users.noreply.github.com>
1 parent ddf9f97 commit 14a930f

File tree

3,807 files changed

+4729
-164448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,807 files changed

+4729
-164448
lines changed

.github/ADR.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../docs/ADR.md

.github/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../docs/CHANGELOG.md

.github/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../docs/CONTRIBUTING.md

.github/apidocs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../docs/apidocs

.github/workflows/build.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,29 @@ jobs:
1313
runs-on: ubuntu-latest
1414
permissions:
1515
contents: write
16+
pages: write
1617

1718
steps:
1819
- uses: actions/checkout@v4
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} # Needed to get PR information, if any
1922
with:
2023
ref: ${{ github.head_ref }}
21-
fetch-depth: 2
2224

2325
- name: Set up JDK 21
24-
uses: actions/setup-java@v1
26+
uses: actions/setup-java@v4
2527
with:
2628
java-version: 21
29+
distribution: 'temurin'
30+
cache: 'maven'
2731

2832
- name: Branch name
2933
run: echo running on branch ${GITHUB_REF#refs/heads/}
3034

3135
- name: Cache Maven packages
32-
uses: actions/cache@v1
36+
uses: actions/cache@v3
3337
with:
3438
path: ~/.m2
35-
token: ${{ secrets.REPO_TOKEN }}
3639
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
3740
restore-keys: ${{ runner.os }}-m2
3841

@@ -52,11 +55,10 @@ jobs:
5255
env:
5356
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} # Needed to get PR information, if any
5457

55-
- name: Publish test report
56-
run: cp -r target/site/serenity/* docs/serenity/
57-
5858
- name: Commit JavaDocs
5959
uses: stefanzweifel/git-auto-commit-action@v5
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} # Needed to get PR information, if any
6062
with:
6163
file_pattern: 'docs/*'
6264
commit_message: 'Update documentation'

.github/workflows/build_mainline.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ jobs:
1111
runs-on: ubuntu-latest
1212
permissions:
1313
contents: write
14+
pages: write
1415

1516
steps:
1617
- uses: actions/checkout@v4
1718
with:
1819
ref: ${{ github.head_ref }}
1920
token: ${{ secrets.REPO_TOKEN }}
20-
fetch-depth: 2
21-
2221

2322
- name: Set up JDK 21
24-
uses: actions/setup-java@v1
23+
uses: actions/setup-java@v4
2524
with:
2625
java-version: 21
26+
distribution: 'temurin'
27+
cache: 'maven'
2728

2829
- name: Branch name
2930
run: echo running on branch ${GITHUB_REF#refs/heads/}
3031

3132
- name: Cache Maven packages
32-
uses: actions/cache@v1
33+
uses: actions/cache@v3
3334
with:
3435
path: ~/.m2
35-
token: ${{ secrets.REPO_TOKEN }}
3636
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
3737
restore-keys: ${{ runner.os }}-m2
3838

docs/ADR.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,36 @@
88
99
see: [adr.github.io](https://adr.github.io/)
1010

11+
---
12+
**Decisions:**
13+
<!-- TOC -->
14+
* [Maintainability 1: Self-documenting tests](#maintainability-1-self-documenting-tests)
15+
<!-- TOC -->
16+
---
17+
1118
## Maintainability 1: Self-documenting tests
1219

1320
**Problem:** Documenting the code and intended functionalities is tedious. It is often neglected and becomes outdated fast.
14-
**Decision:** Use the SerenityBDD framework, but avoid the use of `Gherkin` and `Cucumber`. Try to minimize the impact on the existing test when adding
15-
the self-documenting boilerplate.
21+
**Decision:** Rely on self-documenting tests. Write tests that document the code and intended functionalities.
1622
**Drivers:**
1723

1824
* maintainability
1925
* extensibility
2026
* readability
2127
* minimalism
2228

23-
**Goal:** Write tests that document the code and intended functionalities, use a framework to aggregate these intended
29+
**Goal:** Write tests that document the code and intended functionalities, use a framework to aggregate these intended
2430
functionalities in a human-readable format.
2531
**Concerns:**
2632

2733
* Complexity of adding yet another framework simply for test aggregation
2834
* Overhead of writing artifacts that are not directly related to the code
2935
* Results of the additional documentation will only be read by a few interested parties, most of them are developers who can quite easily read the
30-
executable tests themselves and have less need for an aggregated report.
36+
executable tests themselves and have less need for an aggregated report.
37+
38+
**Considered Alternatives:**
39+
40+
* Use of [Serenity BDD](https://serenity-bdd.github.io/): Removed after experimentation, as the usage was tedious and it tended to overload any PRs
41+
by adding in a multitude of HTML files.
42+
* Custom reporting plugin, combining Javadoc, Markdown, and Jacoco reporting. Did not pursue further, as this would take a significant amount of
43+
effort.

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Following changes are known:
3131

3232
### Added
3333

34+
* Tests illustrating basic usage
35+
* Core functionality implementation
3436
* ReadMe.md file with project intent and outline
3537
* Root pom file with project name and outline
3638
* JavaDoc stylesheet
@@ -40,3 +42,5 @@ Following changes are known:
4042
### Changed
4143

4244
### Removed
45+
46+
* Removed Serenity BDD as a reporting framework, decision in ADR reflects reasoning

docs/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void givenCheckedWithInvalidData_whenApplyingRule_itIsEvaluatedAsInvalid() {
139139

140140
assertThat(result).is(invalid());
141141
assertThat(result.rationale())
142-
.extracting(Rationale::details).asList()
142+
.extracting(Rationale::details).asInstanceOf(LIST)
143143
.contains(failed("mustn't be blank"));
144144
}
145145
```

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A lightweight validation framework for the JVM, allowing for internal and external validation logic to be combined in a transparent and reusable
44
way.
55

6-
| [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=sddevelopment-be_modular-validators&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=sddevelopment-be_modular-validators) | [![All Contributors](https://img.shields.io/github/all-contributors/sddevelopment-be/modular-validators?color=ee8449&style=flat-square)](#contributors) | [Test report](serenity/) | [JavaDoc](apidocs/) |
6+
| [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=sddevelopment-be_modular-validators&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=sddevelopment-be_modular-validators) | [![All Contributors](https://img.shields.io/github/all-contributors/sddevelopment-be/modular-validators?color=ee8449&style=flat-square)](#contributors) | [JavaDoc](https://sddevelopment-be.github.io/modular-validators/apidocs/) |
77

88
---
99

0 commit comments

Comments
 (0)