-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Side effects flush behaviour test (#58)
- Loading branch information
1 parent
985e1dc
commit 598db23
Showing
6 changed files
with
87 additions
and
17 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
functions/collections/impl/src/main/java/dev/restate/e2e/functions/collections/Main.java
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
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
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,37 @@ | ||
package dev.restate.e2e | ||
|
||
import dev.restate.e2e.functions.coordinator.CoordinatorGrpc.CoordinatorBlockingStub | ||
import dev.restate.e2e.functions.coordinator.InvokeSideEffectsRequest | ||
import dev.restate.e2e.utils.InjectBlockingStub | ||
import dev.restate.e2e.utils.RestateDeployer | ||
import dev.restate.e2e.utils.RestateDeployerExtension | ||
import org.assertj.core.api.Assertions.assertThat | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.extension.RegisterExtension | ||
|
||
class SideEffectTest { | ||
companion object { | ||
@RegisterExtension | ||
val deployerExt: RestateDeployerExtension = | ||
RestateDeployerExtension( | ||
RestateDeployer.Builder().withFunction(Containers.COORDINATOR_FUNCTION_SPEC).build()) | ||
} | ||
|
||
@Test | ||
fun sideEffectFlush(@InjectBlockingStub coordinatorClient: CoordinatorBlockingStub) { | ||
assertThat( | ||
coordinatorClient.invokeSideEffects( | ||
InvokeSideEffectsRequest.newBuilder().setLastIsCallback(false).build())) | ||
.extracting { it.invokedTimes } | ||
.isEqualTo(1) | ||
} | ||
|
||
@Test | ||
fun sideEffectThenCallbackFlush(@InjectBlockingStub coordinatorClient: CoordinatorBlockingStub) { | ||
assertThat( | ||
coordinatorClient.invokeSideEffects( | ||
InvokeSideEffectsRequest.newBuilder().setLastIsCallback(true).build())) | ||
.extracting { it.invokedTimes } | ||
.isEqualTo(1) | ||
} | ||
} |