-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
6d3600a
commit 35cf9a5
Showing
3 changed files
with
49 additions
and
0 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
44 changes: 44 additions & 0 deletions
44
src/main/kotlin/dev/restate/sdktesting/tests/RawHandler.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,44 @@ | ||
// Copyright (c) 2023 - Restate Software, Inc., Restate GmbH | ||
// | ||
// This file is part of the Restate SDK Test suite tool, | ||
// which is released under the MIT license. | ||
// | ||
// You can find a copy of the license in file LICENSE in the root | ||
// directory of this repository or package, or at | ||
// https://github.com/restatedev/sdk-test-suite/blob/main/LICENSE | ||
package dev.restate.sdktesting.tests | ||
|
||
import dev.restate.sdk.client.Client | ||
import dev.restate.sdktesting.contracts.TestUtilsServiceClient | ||
import dev.restate.sdktesting.contracts.TestUtilsServiceDefinitions | ||
import dev.restate.sdktesting.infra.InjectClient | ||
import dev.restate.sdktesting.infra.RestateDeployerExtension | ||
import dev.restate.sdktesting.infra.ServiceSpec | ||
import kotlin.random.Random | ||
import kotlinx.coroutines.test.runTest | ||
import org.assertj.core.api.Assertions.assertThat | ||
import org.junit.jupiter.api.DisplayName | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.extension.RegisterExtension | ||
import org.junit.jupiter.api.parallel.Execution | ||
import org.junit.jupiter.api.parallel.ExecutionMode | ||
|
||
class RawHandler { | ||
|
||
companion object { | ||
@RegisterExtension | ||
val deployerExt: RestateDeployerExtension = RestateDeployerExtension { | ||
withServiceSpec( | ||
ServiceSpec.defaultBuilder().withServices(TestUtilsServiceDefinitions.SERVICE_NAME)) | ||
} | ||
} | ||
|
||
@Test | ||
@Execution(ExecutionMode.CONCURRENT) | ||
@DisplayName("Raw input and raw output") | ||
fun rawHandler(@InjectClient ingressClient: Client) = runTest { | ||
val bytes = Random.nextBytes(100) | ||
|
||
assertThat(TestUtilsServiceClient.fromClient(ingressClient).rawEcho(bytes)).isEqualTo(bytes) | ||
} | ||
} |