-
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.
* Fix parameter.toBuilder() * Fix return type of toBuilder to be usuable * Add additional parmeters to test
- Loading branch information
Showing
3 changed files
with
32 additions
and
3 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
26 changes: 26 additions & 0 deletions
26
...ngine/src/test/java/software/amazon/smithy/rulesengine/language/syntax/ParameterTest.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,26 @@ | ||
package software.amazon.smithy.rulesengine.language.syntax; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import software.amazon.smithy.model.node.Node; | ||
import software.amazon.smithy.rulesengine.language.eval.Value; | ||
import software.amazon.smithy.rulesengine.language.syntax.parameters.Parameter; | ||
import software.amazon.smithy.rulesengine.language.syntax.parameters.ParameterType; | ||
|
||
public class ParameterTest { | ||
@Test | ||
void parameterToBuilderRoundTrips() { | ||
Parameter p = Parameter.builder() | ||
.name("test") | ||
.builtIn("Test::BuiltIn") | ||
.required(true) | ||
.defaultValue(Value.bool(true)) | ||
.type(ParameterType.BOOLEAN) | ||
.deprecated(new Parameter.Deprecated("message", "I wrote this test")) | ||
.value(Node.from(true)) | ||
.documentation("here are some docs") | ||
.build(); | ||
assertEquals(p, p.toBuilder().build()); | ||
} | ||
} |