Skip to content

Commit 8986fc3

Browse files
committed
Reorganize tests. Tweak Javadoc formatting
1 parent 0e904f0 commit 8986fc3

2 files changed

Lines changed: 11 additions & 12 deletions

File tree

‎core/src/main/java/io/grpc/transport/HttpUtil.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ public static Http2Error forCode(long code) {
192192
* Looks up the {@link Status} from the given HTTP/2 error code. This is preferred over {@code
193193
* forCode(code).status()}, to more easily conform to HTTP/2:
194194
*
195-
* <blockquote><code>Unknown or unsupported error codes MUST NOT trigger any special behavior.
196-
* These MAY be treated by an implementation as being equivalent to INTERNAL_ERROR.</code>
195+
* <blockquote>Unknown or unsupported error codes MUST NOT trigger any special behavior.
196+
* These MAY be treated by an implementation as being equivalent to INTERNAL_ERROR.</blockquote>
197197
*
198198
* @param code the HTTP/2 error code.
199199
* @return a {@link Status} representing the given error.

‎core/src/test/java/io/grpc/transport/HttpUtilTest.java‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,19 @@
4343
@RunWith(JUnit4.class)
4444
public class HttpUtilTest {
4545
@Test
46-
public void http2ErrorRoundTrip() {
46+
public void http2ErrorForCode() {
4747
// Try edge cases manually, to make the test obviously correct for important cases.
48-
assertSame(Http2Error.NO_ERROR, Http2Error.forCode(Http2Error.NO_ERROR.code()));
49-
assertSame(Http2Error.HTTP_1_1_REQUIRED,
50-
Http2Error.forCode(Http2Error.HTTP_1_1_REQUIRED.code()));
51-
for (Http2Error error : Http2Error.values()) {
52-
assertSame(error, Http2Error.forCode(error.code()));
53-
}
48+
assertNull(Http2Error.forCode(-1));
49+
assertSame(Http2Error.NO_ERROR, Http2Error.forCode(0));
50+
assertSame(Http2Error.HTTP_1_1_REQUIRED, Http2Error.forCode(0xD));
51+
assertNull(Http2Error.forCode(0xD + 1));
5452
}
5553

5654
@Test
57-
public void http2ErrorNoCode() {
58-
assertNull(Http2Error.forCode(-1));
59-
assertNull(Http2Error.forCode(0xD + 1));
55+
public void http2ErrorRoundTrip() {
56+
for (Http2Error error : Http2Error.values()) {
57+
assertSame(error, Http2Error.forCode(error.code()));
58+
}
6059
}
6160

6261
@Test

0 commit comments

Comments
 (0)