Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify all tests #367

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: false
verbose: true
java-version: 17
token: ${{ secrets.CODECOV_TOKEN }}
if: github.ref == 'refs/heads/main'
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore:
- "**/testFixtures/**"
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ abstract class Registrar {
protected fun extractParameter(genericInterface: ParameterizedType): Class<*> =
when (val typeArgument = genericInterface.actualTypeArguments[0]) {
is ParameterizedType -> typeArgument.rawType as Class<*>
is TypeVariable<*> -> extractParameter((genericInterface.rawType as Class<*>).genericInterfaces[0] as ParameterizedType)
is TypeVariable<*> -> {
val rawType = (genericInterface.rawType as Class<*>)
when {
rawType.genericInterfaces.any() -> extractParameter(rawType.genericInterfaces[0] as ParameterizedType)
else -> rawType
}
}

else -> typeArgument as Class<*>
}
}

This file was deleted.

This file was deleted.

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
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading