|
42 | 42 | import software.amazon.smithy.rulesengine.language.syntax.rule.Condition; |
43 | 43 | import software.amazon.smithy.rulesengine.language.syntax.rule.EndpointRule; |
44 | 44 | import software.amazon.smithy.rulesengine.language.syntax.rule.ErrorRule; |
| 45 | +import software.amazon.smithy.rulesengine.language.syntax.rule.Rule; |
45 | 46 | import software.amazon.smithy.rulesengine.language.syntax.rule.TreeRule; |
46 | 47 |
|
47 | 48 | public class DecisionTreeEndpointResolverTest { |
@@ -87,7 +88,7 @@ void testParameterWithDefault() throws Exception { |
87 | 88 | .defaultValue(Value.stringValue("us-east-1")) |
88 | 89 | .build(); |
89 | 90 |
|
90 | | - EndpointRule endpointRule = EndpointRule.builder() |
| 91 | + Rule endpointRule = EndpointRule.builder() |
91 | 92 | .endpoint(Endpoint.builder().url(Expression.getReference(Identifier.of("region"))).build()); |
92 | 93 |
|
93 | 94 | EndpointRuleSet ruleSet = EndpointRuleSet.builder() |
@@ -145,7 +146,7 @@ void testBuiltinParameter() throws Exception { |
145 | 146 | .fn(IsSet.ofExpressions(Expression.getReference(Identifier.of("endpoint")))) |
146 | 147 | .build(); |
147 | 148 |
|
148 | | - EndpointRule endpointRule = EndpointRule.builder() |
| 149 | + Rule endpointRule = EndpointRule.builder() |
149 | 150 | .conditions(List.of(isSetCondition)) |
150 | 151 | .endpoint(Endpoint.builder().url(Expression.getReference(Identifier.of("endpoint"))).build()); |
151 | 152 |
|
@@ -174,7 +175,7 @@ void testBuiltinReturnsNull() throws Exception { |
174 | 175 | .defaultValue(Value.stringValue("https://default.com")) |
175 | 176 | .build(); |
176 | 177 |
|
177 | | - EndpointRule endpointRule = EndpointRule.builder() |
| 178 | + Rule endpointRule = EndpointRule.builder() |
178 | 179 | .endpoint(Endpoint.builder().url(Expression.getReference(Identifier.of("endpoint"))).build()); |
179 | 180 |
|
180 | 181 | EndpointRuleSet ruleSet = EndpointRuleSet.builder() |
@@ -241,10 +242,10 @@ void testMultipleParameterTypes() throws Exception { |
241 | 242 |
|
242 | 243 | @Test |
243 | 244 | void testErrorRuleEvaluation() { |
244 | | - ErrorRule errorRule = ErrorRule.builder().error(Expression.of("Invalid configuration")); |
| 245 | + Rule errorRule = ErrorRule.builder().error(Expression.of("Invalid configuration")); |
245 | 246 |
|
246 | 247 | // Add a fallback endpoint rule that won't be reached |
247 | | - EndpointRule fallbackRule = EndpointRule.builder() |
| 248 | + Rule fallbackRule = EndpointRule.builder() |
248 | 249 | .endpoint(Endpoint.builder().url(Expression.of("https://fallback.com")).build()); |
249 | 250 |
|
250 | 251 | // Use TreeRule to test error within a condition |
@@ -278,7 +279,7 @@ void testParameterPriority() throws Exception { |
278 | 279 | .builtIn("AWS::Region") |
279 | 280 | .build(); |
280 | 281 |
|
281 | | - EndpointRule endpointRule = EndpointRule.builder() |
| 282 | + Rule endpointRule = EndpointRule.builder() |
282 | 283 | .endpoint(Endpoint.builder().url(Expression.getReference(Identifier.of("region"))).build()); |
283 | 284 |
|
284 | 285 | EndpointRuleSet ruleSet = EndpointRuleSet.builder() |
@@ -307,7 +308,7 @@ void testListParameterConversion() throws Exception { |
307 | 308 | .type(ParameterType.STRING_ARRAY) |
308 | 309 | .build(); |
309 | 310 |
|
310 | | - EndpointRule endpointRule = EndpointRule.builder() |
| 311 | + Rule endpointRule = EndpointRule.builder() |
311 | 312 | .endpoint(Endpoint.builder().url(Expression.of(("https://multi-region.example.com"))).build()); |
312 | 313 |
|
313 | 314 | EndpointRuleSet ruleSet = EndpointRuleSet.builder() |
|
0 commit comments