Class RestateRunner

java.lang.Object
dev.restate.sdk.testing.RestateRunner
All Implemented Interfaces:
org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.ParameterResolver

@Deprecated public class RestateRunner extends Object implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.ParameterResolver
Deprecated.
We now recommend using RestateTest.
Restate runner for JUnit 5. Example:
 @RegisterExtension
 private final static RestateRunner restateRunner = RestateRunnerBuilder.create()
         .withService(new MyService())
         .buildRunner();
 

The runner will deploy the services locally, execute Restate as container using Testcontainers, and register the services.

This extension is scoped per test class, meaning that the restate runner will be shared among test methods.

Use the annotations RestateClient, RestateURL and RestateAdminClient to interact with the deployed server:

 @Test
 void initialCountIsZero(@RestateClient Client client) {
     var client = CounterClient.fromClient(ingressClient, "my-counter");

     // Use client as usual
     long response = client.get();
     assertThat(response).isEqualTo(0L);
 }
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    beforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
    Deprecated.
     
    resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    Deprecated.
     
    boolean
    supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
    Deprecated.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • beforeAll

      public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
      Deprecated.
      Specified by:
      beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallback
    • supportsParameter

      public boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException
      Deprecated.
      Specified by:
      supportsParameter in interface org.junit.jupiter.api.extension.ParameterResolver
      Throws:
      org.junit.jupiter.api.extension.ParameterResolutionException
    • resolveParameter

      public Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException
      Deprecated.
      Specified by:
      resolveParameter in interface org.junit.jupiter.api.extension.ParameterResolver
      Throws:
      org.junit.jupiter.api.extension.ParameterResolutionException