Search in sources :

Example 6 with RoutingHeaderRule

use of com.google.api.generator.gapic.model.RoutingHeaderRule 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 RoutingHeaderRule

use of com.google.api.generator.gapic.model.RoutingHeaderRule 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

RoutingHeaderRule (com.google.api.generator.gapic.model.RoutingHeaderRule)7 RoutingHeaderParam (com.google.api.generator.gapic.model.RoutingHeaderRule.RoutingHeaderParam)5 Test (org.junit.Test)5 ClientProto (com.google.api.ClientProto)1 DocumentationRule (com.google.api.DocumentationRule)1 HttpRule (com.google.api.HttpRule)1 ResourceDescriptor (com.google.api.ResourceDescriptor)1 ResourceProto (com.google.api.ResourceProto)1 RoutingParameter (com.google.api.RoutingParameter)1 RoutingRule (com.google.api.RoutingRule)1 TypeNode (com.google.api.generator.engine.ast.TypeNode)1 VaporReference (com.google.api.generator.engine.ast.VaporReference)1 Field (com.google.api.generator.gapic.model.Field)1 GapicBatchingSettings (com.google.api.generator.gapic.model.GapicBatchingSettings)1 GapicContext (com.google.api.generator.gapic.model.GapicContext)1 GapicLanguageSettings (com.google.api.generator.gapic.model.GapicLanguageSettings)1 GapicLroRetrySettings (com.google.api.generator.gapic.model.GapicLroRetrySettings)1 GapicServiceConfig (com.google.api.generator.gapic.model.GapicServiceConfig)1 HttpBindings (com.google.api.generator.gapic.model.HttpBindings)1 LongrunningOperation (com.google.api.generator.gapic.model.LongrunningOperation)1