|
20 | 20 | import static org.junit.Assert.assertThrows; |
21 | 21 | import static org.junit.Assert.assertTrue; |
22 | 22 |
|
| 23 | +import com.google.common.truth.StringSubject; |
23 | 24 | import io.grpc.MethodDescriptor.MethodType; |
24 | 25 | import io.grpc.testing.TestMethodDescriptors; |
25 | 26 | import java.util.Arrays; |
@@ -64,14 +65,17 @@ public void failsOnNonMatchingNames() { |
64 | 65 | List<MethodDescriptor<?, ?>> descriptors = Collections.<MethodDescriptor<?, ?>>singletonList( |
65 | 66 | MethodDescriptor.<Void, Void>newBuilder() |
66 | 67 | .setType(MethodType.UNARY) |
67 | | - .setFullMethodName(MethodDescriptor.generateFullMethodName("wrongservice", "method")) |
| 68 | + .setFullMethodName(MethodDescriptor.generateFullMethodName("wrongService", "method")) |
68 | 69 | .setRequestMarshaller(TestMethodDescriptors.voidMarshaller()) |
69 | 70 | .setResponseMarshaller(TestMethodDescriptors.voidMarshaller()) |
70 | 71 | .build()); |
71 | 72 |
|
72 | 73 | IllegalArgumentException e = assertThrows(IllegalArgumentException.class, |
73 | | - () -> new ServiceDescriptor("name", descriptors)); |
74 | | - assertThat(e).hasMessageThat().isEqualTo("service names wrongservice != name"); |
| 74 | + () -> new ServiceDescriptor("fooService", descriptors)); |
| 75 | + StringSubject error = assertThat(e).hasMessageThat(); |
| 76 | + error.contains("service names"); |
| 77 | + error.contains("fooService"); |
| 78 | + error.contains("wrongService"); |
75 | 79 | } |
76 | 80 |
|
77 | 81 | @Test |
|
0 commit comments