@Test public void failsOnNonDuplicateNames() { List<MethodDescriptor<?, ?>> descriptors = Arrays.<MethodDescriptor<?, ?>>asList( MethodDescriptor.<Void, Void>newBuilder() .setType(MethodType.UNARY) .setFullMethodName(MethodDescriptor.generateFullMethodName("name", "method")) .setRequestMarshaller(TestMethodDescriptors.voidMarshaller()) .setResponseMarshaller(TestMethodDescriptors.voidMarshaller()) .build(), MethodDescriptor.<Void, Void>newBuilder() .setType(MethodType.UNARY) .setFullMethodName(MethodDescriptor.generateFullMethodName("name", "method")) .setRequestMarshaller(TestMethodDescriptors.voidMarshaller()) .setResponseMarshaller(TestMethodDescriptors.voidMarshaller()) .build()); thrown.expect(IllegalArgumentException.class); thrown.expectMessage("duplicate"); new ServiceDescriptor("name", descriptors); }
public static Builder newBuilder(String name) { return new Builder(name); }
ServiceDescriptor { public static Builder newBuilder(String name) { return new Builder(name); } }
ServiceDescriptor { public static Builder newBuilder(String name) { return new Builder(name); } ServiceDescriptor(String name, MethodDescriptor<?, ?>... methods);  ServiceDescriptor(String name, Collection<MethodDescriptor<?, ?>> methods); private  ServiceDescriptor(Builder b); }
ServiceDescriptor { public static Builder newBuilder(String name) { return new Builder(name); } ServiceDescriptor(String name, MethodDescriptor<?, ?>... methods);  ServiceDescriptor(String name, Collection<MethodDescriptor<?, ?>> methods); private  ServiceDescriptor(Builder b); String getName(); Collection<MethodDescriptor<?, ?>> getMethods(); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2222") Object getSchemaDescriptor(); static Builder newBuilder(String name); @Override String toString(); }
ServiceDescriptor { public static Builder newBuilder(String name) { return new Builder(name); } ServiceDescriptor(String name, MethodDescriptor<?, ?>... methods);  ServiceDescriptor(String name, Collection<MethodDescriptor<?, ?>> methods); private  ServiceDescriptor(Builder b); String getName(); Collection<MethodDescriptor<?, ?>> getMethods(); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2222") Object getSchemaDescriptor(); static Builder newBuilder(String name); @Override String toString();  }