-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
791 additions
and
946 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ignore: | ||
- "**/testFixtures/**" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
projects/kediatr-core/src/test/kotlin/com/trendyol/kediatr/CommandHandlerTest.kt
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
projects/kediatr-core/src/test/kotlin/com/trendyol/kediatr/CommandWithResultHandlerTest.kt
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
projects/kediatr-core/src/test/kotlin/com/trendyol/kediatr/MediatorTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.trendyol.kediatr | ||
|
||
import com.trendyol.kediatr.testing.* | ||
import io.kotest.matchers.shouldBe | ||
import org.junit.jupiter.api.Test | ||
|
||
class MediatorTests : MediatorUseCases() { | ||
override fun provideMediator(): Mediator = createMediator( | ||
types = listOf( | ||
TestCommandHandler(mediator = { testMediator }), | ||
TestPipelineCommandHandler(mediator = { testMediator }), | ||
TestCommandWithResultCommandHandler(mediator = { testMediator }), | ||
TestNotificationHandler(mediator = { testMediator }), | ||
TestQueryHandler(mediator = { testMediator }), | ||
TestCommandHandlerWithoutInjection(), | ||
TestInheritedCommandHandlerForSpecificCommand(), | ||
TestCommandHandlerForTypeLimitedInheritance(), | ||
ParameterizedCommandHandler<String>(), | ||
ParameterizedCommandHandlerForInheritance<String>(), | ||
ParameterizedCommandWithResultHandler<Long, String>(), | ||
ParameterizedCommandWithResultHandlerOfInheritedHandler<String>(), | ||
APingHandler(), | ||
AnotherPingHandler(), | ||
Handler1ForNotificationOfMultipleHandlers(), | ||
Handler2ForNotificationOfMultipleHandlers(), | ||
InheritedNotificationHandler(), | ||
ParameterizedNotificationHandler<String>(), | ||
ParameterizedNotificationHandlerForInheritance<String>(), | ||
TestPipelineCommandHandlerWithoutInjection(), | ||
TestPipelineCommandHandlerThatFails(), | ||
ExceptionPipelineBehavior(), | ||
LoggingPipelineBehavior(), | ||
InheritedPipelineBehaviour(), | ||
ParameterizedQueryHandler<Long, String>() | ||
) | ||
) | ||
|
||
@Test | ||
fun `when a publish strategy is defined it should be set`() { | ||
listOf( | ||
ContinueOnExceptionPublishStrategy(), | ||
ParallelNoWaitPublishStrategy(), | ||
ParallelWhenAllPublishStrategy(), | ||
StopOnExceptionPublishStrategy() | ||
).forEach { | ||
val builder = MediatorBuilder(MappingDependencyProvider(hashMapOf())).withPublishStrategy(it) | ||
builder.defaultPublishStrategy shouldBe it | ||
} | ||
} | ||
} |
5 changes: 0 additions & 5 deletions
5
projects/kediatr-core/src/test/kotlin/com/trendyol/kediatr/NotificationHandlerTest.kt
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
projects/kediatr-core/src/test/kotlin/com/trendyol/kediatr/PipelineBehaviorTest.kt
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
projects/kediatr-core/src/test/kotlin/com/trendyol/kediatr/QueryHandlerTest.kt
This file was deleted.
Oops, something went wrong.
135 changes: 0 additions & 135 deletions
135
...-core/src/testFixtures/kotlin/com/trendyol/kediatr/coreUseCases/CommandHandlerUseCases.kt
This file was deleted.
Oops, something went wrong.
123 changes: 0 additions & 123 deletions
123
...testFixtures/kotlin/com/trendyol/kediatr/coreUseCases/CommandWithResultHandlerUseCases.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.