-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add convenience method to get IntEnumShape from GenerateIntEnumDirect…
…ive (#2033) Add a method to GenerateIntEnumDirective to give directed codegen implementers access to the contained shape as an IntEnum.
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
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
16 changes: 16 additions & 0 deletions
16
.../test/java/software/amazon/smithy/codegen/core/directed/GenerateIntEnumDirectiveTest.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,16 @@ | ||
package software.amazon.smithy.codegen.core.directed; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import software.amazon.smithy.model.shapes.BooleanShape; | ||
|
||
public class GenerateIntEnumDirectiveTest { | ||
@Test | ||
public void validatesShapeType() { | ||
BooleanShape shape = BooleanShape.builder().id("smithy.example#Foo").build(); | ||
|
||
Assertions.assertThrows(IllegalArgumentException.class, () -> { | ||
new GenerateIntEnumDirective<TestContext, TestSettings>(null, null, shape); | ||
}); | ||
} | ||
} |