Skip to content

Commit 4674675

Browse files
committed
CR
1 parent e647181 commit 4674675

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

api/src/test/java/io/grpc/MetadataTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public Fish parseStream(InputStream stream) {
120120
public void noPseudoHeaders() {
121121
IllegalArgumentException e = assertThrows(IllegalArgumentException.class,
122122
() -> Metadata.Key.of(":test-bin", FISH_MARSHALLER));
123-
assertThat(e).hasMessageThat().isEqualTo("Invalid character");
123+
assertThat(e).hasMessageThat().isEqualTo("Invalid character ':' in key name ':test-bin'");
124124
}
125125

126126
@Test
@@ -273,7 +273,8 @@ public void shortBinaryKeyName() {
273273
public void invalidSuffixBinaryKeyName() {
274274
IllegalArgumentException e = assertThrows(IllegalArgumentException.class,
275275
() -> Metadata.Key.of("nonbinary", FISH_MARSHALLER));
276-
assertThat(e).hasMessageThat().isEqualTo("Binary header is named nonbinary. It must end with -bin");
276+
assertThat(e).hasMessageThat()
277+
.isEqualTo("Binary header is named nonbinary. It must end with -bin");
277278
}
278279

279280
@Test

core/src/test/java/io/grpc/internal/DnsNameResolverTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ public void maybeChooseServiceConfig_failsOnMisspelling() {
916916
Random random = new Random();
917917
VerifyException e = assertThrows(VerifyException.class,
918918
() -> DnsNameResolver.maybeChooseServiceConfig(bad, random, "host"));
919-
assertThat(e).hasMessageThat().contains("Bad key");
919+
assertThat(e).hasMessageThat().isEqualTo("Bad key: parcentage=1.0");
920920
}
921921

922922
@Test
@@ -1162,7 +1162,7 @@ public void parseTxtResults_badTypeFails() {
11621162

11631163
ClassCastException e = assertThrows(ClassCastException.class,
11641164
() -> DnsNameResolver.parseTxtResults(txtRecords));
1165-
assertThat(e).hasMessageThat().contains("wrong type");
1165+
assertThat(e).hasMessageThat().isEqualTo("wrong type {}");
11661166
}
11671167

11681168
@Test
@@ -1173,7 +1173,7 @@ public void parseTxtResults_badInnerTypeFails() {
11731173

11741174
ClassCastException e = assertThrows(ClassCastException.class,
11751175
() -> DnsNameResolver.parseTxtResults(txtRecords));
1176-
assertThat(e).hasMessageThat().contains("not object");
1176+
assertThat(e).hasMessageThat().isEqualTo("value bogus for idx 0 in [bogus] is not object");
11771177
}
11781178

11791179
@Test

core/src/test/java/io/grpc/internal/GrpcUtilTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,16 @@ public void checkAuthority_succeedsOnIpV6() {
227227
public void checkAuthority_failsOnInvalidAuthority() {
228228
IllegalArgumentException e = assertThrows(IllegalArgumentException.class,
229229
() -> GrpcUtil.checkAuthority("[ : : 1]"));
230-
assertThat(e).hasMessageThat().contains("Invalid authority");
230+
assertThat(e).hasMessageThat().isEqualTo("Invalid authority: [ : : 1]");
231231
}
232232

233233

234234
@Test
235235
public void checkAuthority_userInfoNotAllowed() {
236236
IllegalArgumentException e = assertThrows(IllegalArgumentException.class,
237237
() -> GrpcUtil.checkAuthority("foo@valid"));
238-
assertThat(e).hasMessageThat().contains("Userinfo");
238+
assertThat(e).hasMessageThat()
239+
.isEqualTo("Userinfo must not be present on authority: 'foo@valid'");
239240
}
240241

241242
@Test

core/src/test/java/io/grpc/internal/ManagedChannelImplBuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ public void checkAuthority_validAuthorityAllowed() {
424424
public void checkAuthority_invalidAuthorityFailed() {
425425
IllegalArgumentException e = assertThrows(IllegalArgumentException.class,
426426
() -> builder.checkAuthority(DUMMY_AUTHORITY_INVALID));
427-
assertThat(e).hasMessageThat().contains("Invalid authority");
427+
assertThat(e).hasMessageThat().isEqualTo("Invalid authority: [ : : 1]");
428428
}
429429

430430
@Test
@@ -450,7 +450,7 @@ public void disableCheckAuthority_invalidAuthorityFailed() {
450450
builder.disableCheckAuthority().enableCheckAuthority();
451451
IllegalArgumentException e = assertThrows(IllegalArgumentException.class,
452452
() -> builder.checkAuthority(DUMMY_AUTHORITY_INVALID));
453-
assertThat(e).hasMessageThat().contains("Invalid authority");
453+
assertThat(e).hasMessageThat().isEqualTo("Invalid authority: [ : : 1]");
454454
}
455455

456456
@Test

core/src/test/java/io/grpc/internal/MessageFramerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ static class BytesWritableBufferAllocator implements WritableBufferAllocator {
466466

467467
@Override
468468
public WritableBuffer allocate(int capacityHint) {
469+
System.out.println("allocate " + capacityHint);
469470
allocCount++;
470471
return new ByteWritableBuffer(Math.min(maxSize, Math.max(capacityHint, minSize)));
471472
}

0 commit comments

Comments
 (0)