New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RESTEASY-3300] Do not append single '&' with empty query parameters #3522
Conversation
Hello, Dkafetzis. I'm waiting for one of the admins to verify this patch with /ok-to-test in a comment. |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could actually test this with standard API's rather than internal ones. We could use a ContainerRequestFilter
and get the URI from there to check. In some ways this would be the preferred way IMO.
If we want to stick with using internal API's we should have a method like:
private static Client createClient(final String expectedQuery) {
ResteasyClientBuilder builder = (ResteasyClientBuilder) ClientBuilder.newBuilder();
ResteasyClient client = builder.httpEngine(new ClientHttpEngine() {
@Override
public Response invoke(Invocation request) {
Assert.assertEquals(expectedQuery, ((ClientInvocation) request).getUri().getQuery());
return new AbortedResponse(null, new ServerResponse());
}
@Override
public SSLContext getSslContext() {
return null;
}
@Override
public HostnameVerifier getHostnameVerifier() {
return null;
}
@Override
public void close() {
}
}).build();
}
This would avoid us repeating similar patterns in the test.
This is a little OT for this PR, but I want to remove the usages of ResteascyClientBuilder
and the ResteasyClient
in the test suite where we can. We should be using standard API's for this as they are available.
...ation-tests/src/test/java/org/jboss/resteasy/test/client/RequestNamedQueryParameterTest.java
Show resolved
Hide resolved
...ation-tests/src/test/java/org/jboss/resteasy/test/client/RequestNamedQueryParameterTest.java
Outdated
Show resolved
Hide resolved
@jamezp Changes implemented, waiting for review. |
/retest |
These Windows test failures are from the test added. Do you have access to a Windows VM @Dkafetzis? If not I have a look locally. |
@jamezp should be fine now. Give it another test run |
aa43ccf
to
fd0b021
Compare
@jamezp All tests passed, I think we can merge this. |
Signed-off-by: James R. Perkins <jperkins@redhat.com>
replaced by #3570 |
Fixed this Jira Issue (https://issues.redhat.com/browse/RESTEASY-3300) and added an integration test for this case