Skip to content

Conversation

@nictas
Copy link
Contributor

@nictas nictas commented Feb 19, 2020

Fixes #1034.

mockRequest(InteractionContext.builder()
.request(TestRequest.builder()
.method(GET).path("/oauth/authorize?client_id=app&redirect_uri=http://localhost:8080/app/&scope=openid&response_type=code%20id_token")
.method(GET).path("/oauth/authorize?client_id=app&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fapp%2F&scope=openid&response_type=code%20id_token")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't particularly like how this turned out, but tests like this one already had some encoded characters even before my change. See org.cloudfoundry.reactor.uaa.clients.ReactorClientsTest.list().

@twoseat twoseat added this to the 3.23.0.RELEASE milestone Apr 1, 2020
Copy link
Contributor

@twoseat twoseat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nictas !

.filter(Objects::nonNull);
}

private static UriQueryParameter processValue(AnnotatedValue<QueryParameter> annotatedValue) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical order

.filter(Objects::nonNull);
}

private static UriQueryParameter processValue(AnnotatedValue<FilterParameter> annotatedValue) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical order

.filter(Objects::nonNull);
}

private static UriQueryParameter processValue(AnnotatedValue<FilterParameter> annotatedValue) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical order

.filter(Objects::nonNull);
}

private static <T extends Annotation> Function<Method, AnnotatedValue<T>> processMethod(Object instance, Class<T> annotationClass) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical order?

public class UriQueryParameters {

public static void set(UriComponentsBuilder builder, Stream<UriQueryParameter> uriQueryParameters) {
// Replace all literal values with URI variables to apply more strict encoding:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We rarely include comments as it's often a sign that the code itself is obscure, or a method within it could be named better. Having said that I don't see anything here that should obviously be changed, but if you have any ideas feel free!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also prefer to not include comments, but I think this one will be helpful, since it's not immediately obvious why we're replacing literal values with URI variables.

public UriVariable register(Object value) {
UriVariable uriVariable = UriVariable.of(getNextUriVariableKey(), value);
uriVariables.add(uriVariable);
return uriVariable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

House style is a blank line above return statements if they're not one-liners.

nictas added 3 commits April 2, 2020 13:09
This is a preparation for the next commit where we'll start using URI
variables, instead of literals, for query param values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plus signs are not encoded

2 participants