Skip to content

Commit 522a5ba

Browse files
committed
Unify testing structure and test-cases to maximize the code-use across the frameworks
1 parent 6e34981 commit 522a5ba

File tree

94 files changed

+1806
-2990
lines changed

Some content is hidden

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

94 files changed

+1806
-2990
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Build
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [ main ]
66
pull_request:
7-
branches: [main]
7+
branches: [ main ]
88

99
jobs:
1010
build-and-test:
@@ -22,12 +22,12 @@ jobs:
2222
- name: Gradle Build and Test
2323
uses: gradle/gradle-build-action@v3.5.0
2424
with:
25-
arguments: --build-cache build test jacocoTestReport
25+
arguments: --build-cache build test koverXmlReport
2626

2727
- name: Upload coverage to Codecov
2828
uses: codecov/codecov-action@v4
2929
with:
30-
files: ./build/reports/kediatr-core/jacoco/test/jacocoTestReport.xml,./build/reports/kediatr-koin-starter/jacoco/test/jacocoTestReport.xml,./build/reports/kediatr-quarkus-starter/jacoco/test/jacocoTestReport.xml,./build/reports/kediatr-spring-boot-2x-starter/jacoco/test/jacocoTestReport.xml,./build/reports/kediatr-spring-boot-3x-starter/jacoco/test/jacocoTestReport.xml
30+
files: '**/build/reports/kover/report.xml'
3131
flags: unittests
3232
name: codecov-umbrella
3333
fail_ci_if_error: false
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Publish to Maven
22

33
on:
4-
release:
5-
types: [created]
6-
4+
release:
5+
types: [ created ]
6+
77
jobs:
88
publish:
99
runs-on: ubuntu-latest
@@ -12,21 +12,21 @@ jobs:
1212
packages: write
1313

1414
steps:
15-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
16-
- name: Set up JDK 17
17-
uses: actions/setup-java@v4
18-
with:
19-
java-version: '17'
20-
distribution: 'temurin'
21-
server-id: github
22-
settings-path: ${{ github.workspace }}
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: '17'
20+
distribution: 'temurin'
21+
server-id: github
22+
settings-path: ${{ github.workspace }}
2323

24-
- name: Publish to Maven Repository
25-
uses: gradle/gradle-build-action@v3.5.0
26-
with:
27-
arguments: --build-cache publish
28-
env:
29-
gpg_private_key: ${{ secrets.gpg_private_key }}
30-
gpg_passphrase: ${{ secrets.gpg_passphrase }}
31-
nexus_username: ${{ secrets.nexus_username }}
32-
nexus_password: ${{ secrets.nexus_password }}
24+
- name: Publish to Maven Repository
25+
uses: gradle/gradle-build-action@v3.5.0
26+
with:
27+
arguments: --build-cache publish
28+
env:
29+
gpg_private_key: ${{ secrets.gpg_private_key }}
30+
gpg_passphrase: ${{ secrets.gpg_passphrase }}
31+
nexus_username: ${{ secrets.nexus_username }}
32+
nexus_password: ${{ secrets.nexus_password }}

CHANGELOG.md

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@
1111
# What's Changed
1212

1313
## New
14+
1415
* Support for Spring-Boot 3.1.0 #116 by @osoykan in https://github.com/Trendyol/kediatR/pull/117
1516

1617
## Package bumps
18+
1719
* Update dependency io.quarkus:quarkus-bom to v3.0.3.Final by @renovate in https://github.com/Trendyol/kediatR/pull/110
1820
* Update plugin io.quarkus to v3.0.3.Final by @renovate in https://github.com/Trendyol/kediatR/pull/111
19-
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.7.1 by @renovate in https://github.com/Trendyol/kediatR/pull/114
20-
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-test to v1.7.1 by @renovate in https://github.com/Trendyol/kediatR/pull/113
21-
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-bom to v1.7.1 by @renovate in https://github.com/Trendyol/kediatR/pull/112
21+
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.7.1 by @renovate
22+
in https://github.com/Trendyol/kediatR/pull/114
23+
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-test to v1.7.1 by @renovate
24+
in https://github.com/Trendyol/kediatR/pull/113
25+
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-bom to v1.7.1 by @renovate
26+
in https://github.com/Trendyol/kediatR/pull/112
2227

2328
**Full Changelog**: https://github.com/Trendyol/kediatR/compare/v2.1.0...3.0.0-SNAPSHOT
2429

@@ -27,10 +32,14 @@
2732
## What's Changed
2833

2934
### Enhancements
30-
* Add possibility to invoke publish method with custom publishStrategy by @awaniak in https://github.com/Trendyol/kediatR/pull/92
31-
* Make the quarkus starter work again with quarkus 3.x.x by @lucas-dclrcq in https://github.com/Trendyol/kediatR/pull/109
35+
36+
* Add possibility to invoke publish method with custom publishStrategy by @awaniak
37+
in https://github.com/Trendyol/kediatR/pull/92
38+
* Make the quarkus starter work again with quarkus 3.x.x by @lucas-dclrcq
39+
in https://github.com/Trendyol/kediatR/pull/109
3240

3341
### New Contributors
42+
3443
* @renovate made their first contribution in https://github.com/Trendyol/kediatR/pull/44
3544
* @awaniak made their first contribution in https://github.com/Trendyol/kediatR/pull/92
3645
* @lucas-dclrcq made their first contribution in https://github.com/Trendyol/kediatR/pull/109
@@ -93,9 +102,12 @@
93102
* Update plugin io.quarkus to v3.0.1.Final by @renovate in https://github.com/Trendyol/kediatR/pull/102
94103
* Update plugin io.quarkus to v3.0.2.Final by @renovate in https://github.com/Trendyol/kediatR/pull/104
95104
* Update dependency io.quarkus:quarkus-bom to v2.16.7.Final by @renovate in https://github.com/Trendyol/kediatR/pull/105
96-
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.7.0 by @renovate in https://github.com/Trendyol/kediatR/pull/107
97-
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-test to v1.7.0 by @renovate in https://github.com/Trendyol/kediatR/pull/108
98-
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-bom to v1.7.0 by @renovate in https://github.com/Trendyol/kediatR/pull/106
105+
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.7.0 by @renovate
106+
in https://github.com/Trendyol/kediatR/pull/107
107+
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-test to v1.7.0 by @renovate
108+
in https://github.com/Trendyol/kediatR/pull/108
109+
* Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-bom to v1.7.0 by @renovate
110+
in https://github.com/Trendyol/kediatR/pull/106
99111

100112
**Full Changelog**: https://github.com/Trendyol/kediatR/compare/v2.0.0...v2.1.0
101113

@@ -104,32 +116,37 @@
104116
This is the announcement release for 2.0.0; in other words, SNAPSHOT is promoted to release.
105117

106118
# Breaking Changes
107-
- CommandBus renamed to Mediator #25
119+
120+
- CommandBus renamed to Mediator #25
108121
- ` executeCommand.* executeQuery.*, publishNotification.*` renamed to `send`
109-
- Pipeline behavior refactored with decorator pattern #31
110-
- Sync code is deleted; now it supports only async invocation #26
122+
- Pipeline behavior refactored with decorator pattern #31
123+
- Sync code is deleted; now it supports only async invocation #26
111124

112125
### Bug Fixes
113126

114127
- general:
115-
- fix name for pom while publishing ([4cf70ac](https://github.com/Trendyol/kediatR/commit/4cf70ac439ddf694decf779b601693bd902c150c))
128+
- fix name for pom while
129+
publishing ([4cf70ac](https://github.com/Trendyol/kediatR/commit/4cf70ac439ddf694decf779b601693bd902c150c))
116130

117131
## [v2.0-SNAPSHOT](https://github.com/Trendyol/kediatR/releases/tag/v2.0-SNAPSHOT) - 2022-10-19 09:10:36
118132

119133
# Breaking Changes
120-
- CommandBus renamed to Mediator #25
121-
- Pipeline behavior refactored with decorator pattern #31
122-
- Sync code is deleted; now it supports only async invocation #26
134+
135+
- CommandBus renamed to Mediator #25
136+
- Pipeline behavior refactored with decorator pattern #31
137+
- Sync code is deleted; now it supports only async invocation #26
123138

124139
### Bug Fixes
125140

126141
- general:
127-
- fix the code snippet for sample kediatr-core usage ([e7f09ba](https://github.com/Trendyol/kediatR/commit/e7f09ba81cb07bd873dd22a9eca683b8d9b461eb)) ([#23](https://github.com/Trendyol/kediatR/pull/23))
142+
- fix the code snippet for sample kediatr-core
143+
usage ([e7f09ba](https://github.com/Trendyol/kediatR/commit/e7f09ba81cb07bd873dd22a9eca683b8d9b461eb)) ([#23](https://github.com/Trendyol/kediatR/pull/23))
128144

129145
### Refactor
130146

131147
- general:
132-
- refactor gradle ([3005893](https://github.com/Trendyol/kediatR/commit/3005893ece9745af2e78875c5334e10dc8373296))
133-
- refactor gradle ([023651c](https://github.com/Trendyol/kediatR/commit/023651c1b316029afdaa0bf4e3c199ab80515025))
148+
- refactor gradle ([3005893](https://github.com/Trendyol/kediatR/commit/3005893ece9745af2e78875c5334e10dc8373296))
149+
- refactor gradle ([023651c](https://github.com/Trendyol/kediatR/commit/023651c1b316029afdaa0bf4e3c199ab80515025))
134150

135-
\* *This CHANGELOG was automatically generated by [auto-generate-changelog](https://github.com/BobAnkh/auto-generate-changelog)*
151+
\* *This CHANGELOG was automatically generated
152+
by [auto-generate-changelog](https://github.com/BobAnkh/auto-generate-changelog)*

README.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,49 @@
22

33
<img style="float: left" alt="Humus! The kediatr mascot" src="/humus.png" alt="drawing" width="80"/>
44

5-
Mediator implementation in kotlin with native coroutine support. Supports Spring-Boot, Quarkus and Koin dependency providers.
5+
Mediator implementation in kotlin with native coroutine support. Supports Spring-Boot, Quarkus and Koin dependency
6+
providers.
67

78
Documentation is available at [https://trendyol.github.io/kediatR/](https://trendyol.github.io/kediatR/)
89

910
## Show me the code
1011

1112
```kotlin
12-
class PingCommand: Command // or
13-
class PingQuery: Query<String> // or
14-
class PingNotification: Notification
15-
class PingCommandHandler: CommandHandler<PingCommand> {
16-
override suspend fun handle(command: PingCommand) {
17-
println("Pong!")
18-
}
13+
class PingCommand : Command // or
14+
class PingQuery : Query<String> // or
15+
class PingNotification : Notification
16+
class PingCommandHandler : CommandHandler<PingCommand> {
17+
override suspend fun handle(command: PingCommand) {
18+
println("Pong!")
19+
}
1920
}
20-
class PingQueryHandler: QueryHandler<PingQuery, String> {
21-
override suspend fun handle(query: PingQuery): String {
22-
return "Pong!"
23-
}
21+
class PingQueryHandler : QueryHandler<PingQuery, String> {
22+
override suspend fun handle(query: PingQuery): String {
23+
return "Pong!"
24+
}
2425
}
2526

26-
class PingNotificationHandler: NotificationHandler<PingNotification> {
27-
override suspend fun handle(notification: PingNotification) {
28-
println("Pong!")
29-
}
27+
class PingNotificationHandler : NotificationHandler<PingNotification> {
28+
override suspend fun handle(notification: PingNotification) {
29+
println("Pong!")
30+
}
3031
}
3132

32-
class MeasurePipelineBehaviour: PipelineBehaviour {
33-
override suspend fun <TRequest, TResponse> handle(
34-
request: TRequest,
35-
next: RequestHandlerDelegate<TRequest, TResponse>
36-
): TResponse {
37-
val start = System.currentTimeMillis()
38-
val response = next(request)
39-
val end = System.currentTimeMillis()
40-
println("Request ${request::class.simpleName} took ${end - start} ms")
41-
return response
42-
}
43-
}
33+
class MeasurePipelineBehaviour : PipelineBehaviour {
34+
override suspend fun <TRequest, TResponse> handle(
35+
request: TRequest,
36+
next: RequestHandlerDelegate<TRequest, TResponse>
37+
): TResponse {
38+
val start = System.currentTimeMillis()
39+
val response = next(request)
40+
val end = System.currentTimeMillis()
41+
println("Request ${request::class.simpleName} took ${end - start} ms")
42+
return response
43+
}
44+
}
4445

4546
val mediator = // create mediator instance in-memory or with dependency injection, take a look at the documentation
46-
mediator.send(PingCommand()) // 1..1
47+
mediator.send(PingCommand()) // 1..1
4748
mediator.send(PingQuery()) // 1..1
4849
mediator.send(PingNotification()) // 0..N
4950
```

build.gradle.kts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
group = "com.trendyol"
22

33
plugins {
4-
kotlin("jvm") version libs.versions.kotlin.get()
5-
id("kediatr-publishing") apply false
6-
id("com.palantir.git-version") version "3.1.0"
7-
java
4+
kotlin("jvm") version libs.versions.kotlin.get()
5+
java
6+
id("kediatr-publishing") apply false
7+
alias(libs.plugins.gitVersion)
88
}
99

1010
val versionDetails: groovy.lang.Closure<com.palantir.gradle.gitversion.VersionDetails> by extra
1111
val details = versionDetails()
1212
version = details.lastTag
1313

1414
subprojectsOf("projects") {
15-
apply {
16-
plugin("kotlin")
17-
plugin("kediatr-publishing")
18-
plugin("java")
19-
}
15+
apply {
16+
plugin("kotlin")
17+
plugin("kediatr-publishing")
18+
plugin("java")
19+
}
2020

21-
java {
22-
withSourcesJar()
23-
withJavadocJar()
24-
}
21+
java {
22+
withSourcesJar()
23+
withJavadocJar()
24+
}
2525
}

buildSrc/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
plugins {
2-
`kotlin-dsl`
2+
`kotlin-dsl`
33
}
44

55
repositories {
6-
mavenCentral()
7-
google()
8-
gradlePluginPortal()
6+
mavenCentral()
7+
google()
8+
gradlePluginPortal()
99
}

buildSrc/src/main/kotlin/BuildConstants.kt

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)