nastra commented on code in PR #15989:
URL: https://github.com/apache/iceberg/pull/15989#discussion_r3427295993
##########
core/src/test/java/org/apache/iceberg/rest/TestRESTUtil.java:
##########
@@ -142,12 +191,50 @@ public void
testNamespaceUrlEncodeDecodeDoesNotAllowNull() {
@SuppressWarnings("checkstyle:AvoidEscapedUnicodeCharacters")
public void testOAuth2URLEncoding() {
// from OAuth2, RFC 6749 Appendix B.
+ // encodeString uses form encoding: space -> +
String utf8 = "\u0020\u0025\u0026\u002B\u00A3\u20AC";
String expected = "+%25%26%2B%C2%A3%E2%82%AC";
assertThat(RESTUtil.encodeString(utf8)).isEqualTo(expected);
}
Review Comment:
can we add some tests here to make it more explicit how old/new
client/server behavior is defined? For example, an old client (`encodeString`)
talking to a new server (`decodePathSegment`). The same would apply for
`encodeNamespace/decodeNamespace` /
`encodeNamespaceAsPathSegment/decodeNamespaceAsPathSegment`. This makes it
easier to reason about what the actual behavior is in these scenarios and can
be named similar to `encodeAsOldClientAndDecodeAsNewServer()`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]