-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix all the package names to use the new release artifacts
Update READMEs Add tests
- Loading branch information
1 parent
28db66a
commit 2e7aa90
Showing
20 changed files
with
322 additions
and
125 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
34 changes: 34 additions & 0 deletions
34
jvm/java-blocking-http/src/test/java/dev/restate/sdk/examples/GreeterTest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package dev.restate.sdk.examples; | ||
|
||
import dev.restate.sdk.examples.generated.GreeterGrpc; | ||
import dev.restate.sdk.examples.generated.GreeterGrpc.GreeterBlockingStub; | ||
import dev.restate.sdk.examples.generated.GreeterProto.GreetRequest; | ||
import dev.restate.sdk.examples.generated.GreeterProto.GreetResponse; | ||
import dev.restate.sdk.testing.RestateGrpcChannel; | ||
import dev.restate.sdk.testing.RestateRunner; | ||
import dev.restate.sdk.testing.RestateRunnerBuilder; | ||
import io.grpc.ManagedChannel; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
class GreeterTest { | ||
|
||
// Runner runs Restate using testcontainers and registers services | ||
@RegisterExtension | ||
private static final RestateRunner restateRunner = RestateRunnerBuilder.create() | ||
// Service to test | ||
.withService(new Greeter()) | ||
.buildRunner(); | ||
|
||
@Test | ||
void testGreet( | ||
// Channel to send requests to Restate services | ||
@RestateGrpcChannel ManagedChannel channel) { | ||
GreeterBlockingStub client = GreeterGrpc.newBlockingStub(channel); | ||
GreetResponse response = client.greet(GreetRequest.newBuilder().setName("Francesco").build()); | ||
|
||
assertEquals("Hello Francesco for the 1 time!", response.getMessage()); | ||
} | ||
} |
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
11 changes: 0 additions & 11 deletions
11
jvm/java-blocking-lambda/src/main/java/dev/restate/sdk/examples/LambdaFactory.java
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
jvm/java-blocking-lambda/src/main/java/dev/restate/sdk/examples/LambdaHandler.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package dev.restate.sdk.examples; | ||
|
||
import dev.restate.sdk.lambda.BaseRestateLambdaHandler; | ||
import dev.restate.sdk.lambda.RestateLambdaEndpointBuilder; | ||
|
||
public class LambdaHandler extends BaseRestateLambdaHandler { | ||
@Override | ||
public void register(RestateLambdaEndpointBuilder builder) { | ||
builder.withService(new Greeter()); | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
...da/src/main/resources/META-INF/services/dev.restate.sdk.lambda.LambdaRestateServerFactory
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
jvm/java-blocking-lambda/src/test/java/dev/restate/sdk/examples/GreeterTest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package dev.restate.sdk.examples; | ||
|
||
import dev.restate.sdk.examples.generated.GreeterGrpc; | ||
import dev.restate.sdk.examples.generated.GreeterGrpc.GreeterBlockingStub; | ||
import dev.restate.sdk.examples.generated.GreeterProto.GreetRequest; | ||
import dev.restate.sdk.examples.generated.GreeterProto.GreetResponse; | ||
import dev.restate.sdk.testing.RestateGrpcChannel; | ||
import dev.restate.sdk.testing.RestateRunner; | ||
import dev.restate.sdk.testing.RestateRunnerBuilder; | ||
import io.grpc.ManagedChannel; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
class GreeterTest { | ||
|
||
// Runner runs Restate using testcontainers and registers services | ||
@RegisterExtension | ||
private static final RestateRunner restateRunner = RestateRunnerBuilder.create() | ||
// Service to test | ||
.withService(new Greeter()) | ||
.buildRunner(); | ||
|
||
@Test | ||
void testGreet( | ||
// Channel to send requests to Restate services | ||
@RestateGrpcChannel ManagedChannel channel) { | ||
GreeterBlockingStub client = GreeterGrpc.newBlockingStub(channel); | ||
GreetResponse response = client.greet(GreetRequest.newBuilder().setName("Francesco").build()); | ||
|
||
assertEquals("Hello Francesco for the 1 time!", response.getMessage()); | ||
} | ||
} |
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
Oops, something went wrong.