-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
ac82682
commit d466b0d
Showing
5 changed files
with
66 additions
and
8 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
18 changes: 18 additions & 0 deletions
18
sdk-api-gen/src/test/java/dev/restate/sdk/GreeterWithExplicitName.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,18 @@ | ||
// Copyright (c) 2023 - Restate Software, Inc., Restate GmbH | ||
// | ||
// This file is part of the Restate Java SDK, | ||
// 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-java/blob/main/LICENSE | ||
package dev.restate.sdk; | ||
|
||
import dev.restate.sdk.annotation.Handler; | ||
import dev.restate.sdk.annotation.Service; | ||
|
||
@Service(name = "MyExplicitName") | ||
public interface GreeterWithExplicitName { | ||
@Handler | ||
String greet(Context context, String request); | ||
} |
18 changes: 18 additions & 0 deletions
18
sdk-api-gen/src/test/java/dev/restate/sdk/GreeterWithoutExplicitName.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,18 @@ | ||
// Copyright (c) 2023 - Restate Software, Inc., Restate GmbH | ||
// | ||
// This file is part of the Restate Java SDK, | ||
// 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-java/blob/main/LICENSE | ||
package dev.restate.sdk; | ||
|
||
import dev.restate.sdk.annotation.Handler; | ||
import dev.restate.sdk.annotation.Service; | ||
|
||
@Service | ||
public interface GreeterWithoutExplicitName { | ||
@Handler | ||
String greet(Context context, String request); | ||
} |
25 changes: 25 additions & 0 deletions
25
sdk-api-gen/src/test/java/dev/restate/sdk/NameInferenceTest.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,25 @@ | ||
// Copyright (c) 2023 - Restate Software, Inc., Restate GmbH | ||
// | ||
// This file is part of the Restate Java SDK, | ||
// 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-java/blob/main/LICENSE | ||
package dev.restate.sdk; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class NameInferenceTest { | ||
|
||
@Test | ||
void expectedName() { | ||
assertThat(CodegenTestServiceGreeterClient.COMPONENT_NAME) | ||
.isEqualTo("CodegenTestServiceGreeter"); | ||
assertThat(GreeterWithoutExplicitNameClient.COMPONENT_NAME) | ||
.isEqualTo("GreeterWithoutExplicitName"); | ||
assertThat(MyExplicitNameClient.COMPONENT_NAME).isEqualTo("MyExplicitName"); | ||
} | ||
} |
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