use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project resteasy by resteasy.
the class TrailingSlashTest method doTwoArgConstructorTest.
void doTwoArgConstructorTest(URI base, URI relative, String path) throws URISyntaxException {
ResteasyUriInfo ruri = new ResteasyUriInfo(base, relative);
Assert.assertEquals(ERROR_MSG, path, ruri.getPath());
Assert.assertEquals(ERROR_MSG, path, ruri.getPath(true));
Assert.assertEquals(ERROR_MSG, path, ruri.getPath(false));
URI newUri;
if (base.toString().endsWith("/")) {
newUri = new URI(base.toString().substring(0, base.toString().length() - 1) + path);
} else {
newUri = new URI(base.toString() + path);
}
Assert.assertEquals(ERROR_MSG, newUri, ruri.getAbsolutePath());
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project resteasy by resteasy.
the class TrailingSlashTest method doTwoStringArgConstructorTest.
void doTwoStringArgConstructorTest(String s, String path) throws URISyntaxException {
ResteasyUriInfo ruri = new ResteasyUriInfo(s, "");
URI uri = new URI(s);
Assert.assertEquals(ERROR_MSG, path, ruri.getPath());
Assert.assertEquals(ERROR_MSG, path, ruri.getPath(true));
Assert.assertEquals(ERROR_MSG, path, ruri.getPath(false));
Assert.assertEquals(ERROR_MSG, uri, ruri.getAbsolutePath());
Assert.assertEquals(ERROR_MSG, uri, ruri.getBaseUri().resolve(ruri.getPath(false)));
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project resteasy by resteasy.
the class TrailingSlashTest method doOneArgConstructorTest.
void doOneArgConstructorTest(URI uri, String path) {
ResteasyUriInfo ruri = new ResteasyUriInfo(uri);
Assert.assertEquals(ERROR_MSG, path, ruri.getPath());
Assert.assertEquals(ERROR_MSG, path, ruri.getPath(true));
Assert.assertEquals(ERROR_MSG, path, ruri.getPath(false));
Assert.assertEquals(ERROR_MSG, uri, ruri.getAbsolutePath());
Assert.assertEquals(ERROR_MSG, uri, ruri.getBaseUri().resolve(ruri.getPath(false)));
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project resteasy by resteasy.
the class TrailingSlashTest method doTwoArgConstructorTest.
void doTwoArgConstructorTest(String s, String path) throws URISyntaxException {
ResteasyUriInfo ruri = new ResteasyUriInfo(s, "");
URI uri = new URI(s);
Assert.assertEquals(ERROR_MSG, path, ruri.getPath());
Assert.assertEquals(ERROR_MSG, path, ruri.getPath(true));
Assert.assertEquals(ERROR_MSG, path, ruri.getPath(false));
Assert.assertEquals(ERROR_MSG, uri, ruri.getAbsolutePath());
Assert.assertEquals(ERROR_MSG, uri, ruri.getBaseUri().resolve(ruri.getPath(false)));
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project resteasy by resteasy.
the class ResourceMethodInvoker method invokeDryRun.
public CompletionStage<Object> invokeDryRun(HttpRequest request, HttpResponse response, Object target) {
request.setAttribute(ResourceMethodInvoker.class.getName(), this);
incrementMethodCount(request.getHttpMethod());
ResteasyUriInfo uriInfo = (ResteasyUriInfo) request.getUri();
if (method.getPath() != null) {
uriInfo.pushMatchedURI(uriInfo.getMatchingPath());
}
uriInfo.pushCurrentResource(target);
return invokeOnTargetDryRun(request, response, target);
}
Aggregations