Search in sources :

Example 11 with MethodConfigProto

use of com.google.api.codegen.MethodConfigProto in project toolkit by googleapis.

the class SampleSpecTest method valueSetsReferencedMultipleTimes.

@Test
public void valueSetsReferencedMultipleTimes() {
    final MethodConfigProto methodConfigProto = MethodConfigProto.newBuilder().addSampleValueSets(SampleValueSet.newBuilder().setId("alice")).addSampleValueSets(SampleValueSet.newBuilder().setId("bob")).setSamples(SampleConfiguration.newBuilder().addStandalone(SampleTypeConfiguration.newBuilder().addValueSets("alice").addCallingForms(".*")).addStandalone(SampleTypeConfiguration.newBuilder().addValueSets("bob").addCallingForms(".*")).addStandalone(SampleTypeConfiguration.newBuilder().addValueSets("alice").addCallingForms(".*"))).build();
    SampleSpec sampleSpec = new SampleSpec(methodConfigProto);
    assertThat(sampleSpec.getSampleConfigs(Collections.singletonList(CallingForm.Request), CallingForm.Request, null, SampleType.STANDALONE)).hasSize(3);
}
Also used : MethodConfigProto(com.google.api.codegen.MethodConfigProto) Test(org.junit.Test)

Aggregations

MethodConfigProto (com.google.api.codegen.MethodConfigProto)11 Method (com.google.api.tools.framework.model.Method)4 ImmutableMap (com.google.common.collect.ImmutableMap)4 Test (org.junit.Test)4 InterfaceConfigProto (com.google.api.codegen.InterfaceConfigProto)3 Interface (com.google.api.tools.framework.model.Interface)3 CollectionConfigProto (com.google.api.codegen.CollectionConfigProto)2 Method (com.google.api.codegen.discovery.Method)2 ImmutableList (com.google.common.collect.ImmutableList)2 ImmutableSet (com.google.common.collect.ImmutableSet)2 Truth.assertThat (com.google.common.truth.Truth.assertThat)2 ArrayList (java.util.ArrayList)2 Collections (java.util.Collections)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 ResourceDescriptor (com.google.api.ResourceDescriptor)1 ResourceReference (com.google.api.ResourceReference)1 CollectionOneofProto (com.google.api.codegen.CollectionOneofProto)1 ConfigProto (com.google.api.codegen.ConfigProto)1 DeprecatedCollectionConfigProto (com.google.api.codegen.DeprecatedCollectionConfigProto)1