Search in sources :

Example 6 with RoutingHeaderParam

use of com.google.api.generator.gapic.model.RoutingHeaderRule.RoutingHeaderParam in project gapic-generator-java by googleapis.

the class RoutingRuleParserTest method parse_shouldSetPathTemplateToWildcardIfNotDefined.

@Test
public void parse_shouldSetPathTemplateToWildcardIfNotDefined() {
    RoutingHeaderRule actual = getRoutingHeaders(1);
    RoutingHeaderParam expected = RoutingHeaderParam.create("name", "name", String.format("{%s=**}", "name"));
    assertThat(actual.routingHeaderParams()).containsExactly(expected);
}
Also used : RoutingHeaderParam(com.google.api.generator.gapic.model.RoutingHeaderRule.RoutingHeaderParam) RoutingHeaderRule(com.google.api.generator.gapic.model.RoutingHeaderRule) Test(org.junit.Test)

Example 7 with RoutingHeaderParam

use of com.google.api.generator.gapic.model.RoutingHeaderRule.RoutingHeaderParam in project gapic-generator-java by googleapis.

the class RoutingRuleParserTest method parse_shouldParseRoutingRulesWithMultipleParameter.

@Test
public void parse_shouldParseRoutingRulesWithMultipleParameter() {
    RoutingHeaderRule actual = getRoutingHeaders(5);
    RoutingHeaderParam expectedHeader1 = RoutingHeaderParam.create("name", "rename", "/v1beta1/{rename=tests/*}");
    RoutingHeaderParam expectedHeader2 = RoutingHeaderParam.create("routing_id", "id", "/v1beta1/{id=projects/*}/tables/*");
    assertThat(actual.routingHeaderParams()).containsExactly(expectedHeader1, expectedHeader2).inOrder();
}
Also used : RoutingHeaderParam(com.google.api.generator.gapic.model.RoutingHeaderRule.RoutingHeaderParam) RoutingHeaderRule(com.google.api.generator.gapic.model.RoutingHeaderRule) Test(org.junit.Test)

Aggregations

RoutingHeaderParam (com.google.api.generator.gapic.model.RoutingHeaderRule.RoutingHeaderParam)7 RoutingHeaderRule (com.google.api.generator.gapic.model.RoutingHeaderRule)5 Test (org.junit.Test)5 RoutingParameter (com.google.api.RoutingParameter)1 RoutingRule (com.google.api.RoutingRule)1 AssignmentExpr (com.google.api.generator.engine.ast.AssignmentExpr)1 EnumRefExpr (com.google.api.generator.engine.ast.EnumRefExpr)1 Expr (com.google.api.generator.engine.ast.Expr)1 ExprStatement (com.google.api.generator.engine.ast.ExprStatement)1 IfStatement (com.google.api.generator.engine.ast.IfStatement)1 LambdaExpr (com.google.api.generator.engine.ast.LambdaExpr)1 LogicalOperationExpr (com.google.api.generator.engine.ast.LogicalOperationExpr)1 MethodInvocationExpr (com.google.api.generator.engine.ast.MethodInvocationExpr)1 RelationalOperationExpr (com.google.api.generator.engine.ast.RelationalOperationExpr)1 Statement (com.google.api.generator.engine.ast.Statement)1 TypeNode (com.google.api.generator.engine.ast.TypeNode)1 ValueExpr (com.google.api.generator.engine.ast.ValueExpr)1 Variable (com.google.api.generator.engine.ast.Variable)1 VariableExpr (com.google.api.generator.engine.ast.VariableExpr)1 PathTemplate (com.google.api.pathtemplate.PathTemplate)1